Skip to content

Commit

Permalink
Merge pull request #142415 from Artturin/crossfixes1
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Oct 26, 2021
2 parents aaa66ba + e937fd5 commit 2558d8e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 12 deletions.
7 changes: 5 additions & 2 deletions pkgs/tools/inputmethods/m17n-db/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, gettext }:
{ lib, stdenv, fetchurl, gettext, gawk, bash }:

stdenv.mkDerivation rec {
pname = "m17n-db";
Expand All @@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "0vfw7z9i2s9np6nmx1d4dlsywm044rkaqarn7akffmb6bf1j6zv5";
};

buildInputs = [ gettext ];
nativeBuildInputs = [ gettext ];
buildInputs = [ gettext gawk bash ];

strictDeps = true;

configureFlags = lib.optional (stdenv ? glibc)
"--with-charmaps=${stdenv.glibc.out}/share/i18n/charmaps"
Expand Down
7 changes: 6 additions & 1 deletion pkgs/tools/inputmethods/m17n-lib/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -8,6 +8,11 @@ stdenv.mkDerivation rec {
sha256 = "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq";
};

strictDeps = true;

# reconf needed to sucesfully cross-compile
nativeBuildInputs = [ autoreconfHook pkg-config ];

buildInputs = [ m17n_db ];

meta = {
Expand Down
42 changes: 33 additions & 9 deletions pkgs/tools/inputmethods/m17n-lib/otf.nix
Original file line number Diff line number Diff line change
@@ -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/";
Expand Down

0 comments on commit 2558d8e

Please sign in to comment.