Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS aarch64 libsass for Apple M1 #49

Merged
merged 6 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/buildAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ cp src/native/lib/libsass.so src/main/resources/linux-x86/libsass.so
./bin/docker/buildLinux/x86/dockcross make -C src/native/ clean

docker run --rm -v $(pwd)/bin/docker/buildLinux/x86-64/:/Compile -v $(pwd):/sass libsass/linux:1
docker run --rm -v $(pwd)/bin/docker/buildDarwin:/Compile -v $(pwd):/sass libsass/darwin:1
docker run --rm -v $(pwd)/bin/docker/buildDarwin-x86-64:/Compile -v $(pwd):/sass libsass/darwin-x86-64:1
1 change: 1 addition & 0 deletions bin/docker/buildDarwin-aarch64/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Needs something to compile libsaas on `arm64` arch.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
cd /sass

rm -r src/main/resources/darwin
rm -r src/main/resources/darwin-x86-64
mkdir -p src/main/resources/darwin
mkdir -p src/main/resources/darwin-x86-64

# *** Build libsass
make -C src/native clean
Expand All @@ -21,6 +23,7 @@ BUILD=shared \

# *** Copy to target location. Note that the makefile from libsass will output a .so file. Renaming it to .dylib is good enough.
cp src/native/lib/libsass.so src/main/resources/darwin/libsass.dylib || exit 1
cp src/native/lib/libsass.so src/main/resources/darwin-x86-64/libsass.dylib || exit 1

# *** Cleanup
cd /sass/src/native
Expand Down
8 changes: 5 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ javaOptions += "-Djna.nosys=true"
addSbtPlugin("com.typesafe.sbt" % "sbt-web" % "1.4.4")

libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.5" % "test",
"net.java.dev.jna" % "jna" % "5.5.0"
"org.scalatest" %% "scalatest" % "3.2.10" % "test",
"org.scalatest" %% "scalatest-mustmatchers" % "3.2.10" % "test",
"org.scalatest" %% "scalatest-funspec" % "3.2.10" % "test",
"net.java.dev.jna" % "jna" % "5.10.0"
)

// Compiler settings
Expand All @@ -32,7 +34,7 @@ scalacOptions ++= Seq(
"-encoding",
"UTF-8"
)
javacOptions ++= Seq("-source", "1.7", "-target", "1.7", "-Xlint")
javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint")

// Bintray settings
bintrayOrganization in bintray := None
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.10
sbt.version=1.6.1
porchy13 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.1")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")

addCompilerPlugin("org.psywerx.hairyfotr" %% "linter" % "0.1.17")
Binary file added src/main/resources/darwin-aarch64/libsass.dylib
Binary file not shown.
Binary file added src/main/resources/darwin-x86-64/libsass.dylib
Binary file not shown.
5 changes: 3 additions & 2 deletions src/test/scala/org/irundaia/sass/SassCompilerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ package org.irundaia.sass

import java.nio.file.{Paths, Files}

import org.scalatest.{FunSpec, MustMatchers}
import org.scalatest.funspec.AnyFunSpec;
import org.scalatest.matchers.must._;

import scala.io.Source

class SassCompilerTest extends FunSpec with MustMatchers {
class SassCompilerTest extends AnyFunSpec with Matchers {
val testDir = Files.createTempDirectory("sbt-sassify")
val compilerSettings = CompilerSettings(Minified, true, true, Auto, Seq(), "", 10, "css")

Expand Down