summary refs log tree commit diff
path: root/pkgs/tools/misc/otfcc
diff options
context:
space:
mode:
authorEnno Lohmeier <enno@nerdworks.de>2020-08-07 18:25:26 +0200
committerEnno Lohmeier <enno@nerdworks.de>2020-08-07 19:16:25 +0200
commita10a9a77b7432ee10f3b342861d1c46bb41421c5 (patch)
tree4bca99f5afe70ceedb9c1adce63c3261b53aed02 /pkgs/tools/misc/otfcc
parentb9bf9c9236ae949d393746c2a915ee57d21815a5 (diff)
downloadnixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.tar
nixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.tar.gz
nixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.tar.bz2
nixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.tar.lz
nixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.tar.xz
nixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.tar.zst
nixpkgs-a10a9a77b7432ee10f3b342861d1c46bb41421c5.zip
otfcc: fix aarch64 compatibility
Diffstat (limited to 'pkgs/tools/misc/otfcc')
-rw-r--r--pkgs/tools/misc/otfcc/default.nix16
-rw-r--r--pkgs/tools/misc/otfcc/fix-aarch64.patch22
-rw-r--r--pkgs/tools/misc/otfcc/move-makefiles.patch13
3 files changed, 43 insertions, 8 deletions
diff --git a/pkgs/tools/misc/otfcc/default.nix b/pkgs/tools/misc/otfcc/default.nix
index c3ca53616f7..dc7e3effe0a 100644
--- a/pkgs/tools/misc/otfcc/default.nix
+++ b/pkgs/tools/misc/otfcc/default.nix
@@ -13,16 +13,16 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ premake5 ];
 
-  # Don’t guess where our makefiles will end up. Just use current
-  # directory.
-  patchPhase = ''
-    substituteInPlace premake5.lua \
-      --replace 'location "build/gmake"' 'location "."'
-  '';
+  patches = [
+    ./fix-aarch64.patch
+    ./move-makefiles.patch
+  ];
+
+  buildFlags = stdenv.lib.optional stdenv.isAarch64 [ "config=release_arm" ];
 
   installPhase = ''
     mkdir -p $out/bin
-    cp bin/release-x*/otfcc* $out/bin/
+    cp bin/release-*/otfcc* $out/bin/
   '';
 
   enableParallelBuilding = true;
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     description = "Optimized OpenType builder and inspector";
     homepage = "https://github.com/caryll/otfcc";
     license = licenses.asl20;
-    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+    platforms = [ "aarch64-linux" "i686-linux" "x86_64-linux" "x86_64-darwin" ];
     maintainers = with maintainers; [ jfrankenau ttuegel ];
   };
 
diff --git a/pkgs/tools/misc/otfcc/fix-aarch64.patch b/pkgs/tools/misc/otfcc/fix-aarch64.patch
new file mode 100644
index 00000000000..80fcb625658
--- /dev/null
+++ b/pkgs/tools/misc/otfcc/fix-aarch64.patch
@@ -0,0 +1,22 @@
+diff --git a/premake5.lua b/premake5.lua
+index 997fd79..54a20a0 100644
+--- a/premake5.lua
++++ b/premake5.lua
+@@ -49,7 +49,7 @@ end
+ workspace "otfcc"
+ 	configurations { "release", "debug" }
+ 	
+-	platforms { "x64", "x86" }
++	platforms { "x64", "x86", "arm" }
+ 	filter "action:xcode4"
+ 		platforms { "x64" }
+ 	filter {}
+@@ -67,6 +67,8 @@ workspace "otfcc"
+ 		architecture "x86"
+ 	filter "platforms:x64"
+ 		architecture "x64"
++	filter "platforms:arm"
++		architecture "arm"
+ 	filter {}
+ 	
+ 	filter "action:vs2017"
diff --git a/pkgs/tools/misc/otfcc/move-makefiles.patch b/pkgs/tools/misc/otfcc/move-makefiles.patch
new file mode 100644
index 00000000000..961c47b3b45
--- /dev/null
+++ b/pkgs/tools/misc/otfcc/move-makefiles.patch
@@ -0,0 +1,13 @@
+diff --git a/premake5.lua b/premake5.lua
+index 997fd79..54a20a0 100644
+--- a/premake5.lua
++++ b/premake5.lua
+@@ -88,7 +90,7 @@ workspace "otfcc"
+ 		flags { "StaticRuntime" }
+ 		includedirs { "dep/polyfill-msvc" }
+ 	filter "action:gmake"
+-		location "build/gmake"
++		location "."
+ 	filter "action:xcode4"
+ 		location "build/xcode"
+ 	filter {}