about summary refs log tree commit diff
path: root/pkgs/tools/inputmethods/m17n-lib
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-10-26 18:01:57 +0000
committerGitHub <noreply@github.com>2021-10-26 18:01:57 +0000
commit7455d89599c48d5e8de7c7a1ecc7974435d56c8b (patch)
tree4ec883543fc43fc3139757720bf99cc16b55c203 /pkgs/tools/inputmethods/m17n-lib
parent4ed40e8ff9c2a68cc8f5dbe37e22400d1c64ab02 (diff)
parent9a27efeb34d572436e9e9f57bee1a8d28589a6ae (diff)
downloadnixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.tar
nixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.tar.gz
nixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.tar.bz2
nixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.tar.lz
nixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.tar.xz
nixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.tar.zst
nixlib-7455d89599c48d5e8de7c7a1ecc7974435d56c8b.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/tools/inputmethods/m17n-lib')
-rw-r--r--pkgs/tools/inputmethods/m17n-lib/default.nix7
-rw-r--r--pkgs/tools/inputmethods/m17n-lib/otf.nix42
2 files changed, 39 insertions, 10 deletions
diff --git a/pkgs/tools/inputmethods/m17n-lib/default.nix b/pkgs/tools/inputmethods/m17n-lib/default.nix
index 8fb93c9c5f3a..2ca60bca3e74 100644
--- a/pkgs/tools/inputmethods/m17n-lib/default.nix
+++ b/pkgs/tools/inputmethods/m17n-lib/default.nix
@@ -1,4 +1,4 @@
-{lib, stdenv, fetchurl, m17n_db}:
+{ lib, stdenv, fetchurl, m17n_db, autoreconfHook, pkg-config }:
 stdenv.mkDerivation rec {
   pname = "m17n-lib";
   version = "1.8.0";
@@ -8,6 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq";
   };
 
+  strictDeps = true;
+
+  # reconf needed to sucesfully cross-compile
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
   buildInputs = [ m17n_db ];
 
   # Fails parallel build due to missing intra-package depends:
diff --git a/pkgs/tools/inputmethods/m17n-lib/otf.nix b/pkgs/tools/inputmethods/m17n-lib/otf.nix
index f4d276e0a61d..b0d30a58d48e 100644
--- a/pkgs/tools/inputmethods/m17n-lib/otf.nix
+++ b/pkgs/tools/inputmethods/m17n-lib/otf.nix
@@ -1,22 +1,46 @@
-{ lib, stdenv, fetchurl, libXaw, freetype }:
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, libXaw, freetype }:
 
 stdenv.mkDerivation rec {
-  name = "libotf-0.9.16";
+  pname = "libotf";
+  version = "0.9.16";
 
   src = fetchurl {
-    url = "https://download.savannah.gnu.org/releases/m17n/${name}.tar.gz";
+    url = "https://download.savannah.gnu.org/releases/m17n/${pname}-${version}.tar.gz";
     sha256 = "0sq6g3xaxw388akws6qrllp3kp2sxgk2dv4j79k6mm52rnihrnv8";
   };
 
-  outputs = [ "out" "dev" ];
+  patches = [
+    # https://salsa.debian.org/debian/libotf/-/tree/master/debian/patches
+    # Fix cross-compilation
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0002-use-pkg-config-not-freetype-config.patch";
+      sha256 = "sha256-VV9iGoNWIEie6UiLLTJBD+zxpvj0acgqkcBeAN1V6Kc=";
+    })
+    # these 2 are required by the above patch
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0001-do-not-add-flags-for-required-packages-to-pc-file.patch";
+      sha256 = "sha256-3kzqNPAHNVJQ1F4fyifq3AqLdChWli/k7wOq+ha+iDs=";
+    })
+    (fetchpatch {
+      url = "https://salsa.debian.org/debian/libotf/-/raw/1be04cedf887720eb8f5efb3594dc2cefd96b1f1/debian/patches/0001-libotf-config-modify-to-support-multi-arch.patch";
+      sha256 = "sha256-SUlI87h+MtYWWtrAegzAnSds8JhxZwTJltDcj/se/Qc=";
+    })
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
 
   buildInputs = [ libXaw freetype ];
 
-  postInstall =
-    ''
-      mkdir -p $dev/bin
-      mv $out/bin/libotf-config $dev/bin/
-    '';
+  outputs = [ "out" "dev" ];
+
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $out/bin/libotf-config $dev/bin/
+    substituteInPlace $dev/bin/libotf-config \
+      --replace "pkg-config" "${pkg-config}/bin/pkg-config"
+  '';
 
   meta = {
     homepage = "https://www.nongnu.org/m17n/";