-
-
Notifications
You must be signed in to change notification settings - Fork 18k
gobject-introspection: support cross-compilation #176464
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6e62922
meson: add mesonEmulatorHook
Artturin 163ffce
prelink: 20130503 -> unstable-2019-06-24 cross_prelink branch
Artturin 79d349b
gobject-introspection: support cross-compilation
Artturin 41f8722
gobject-introspection: add artturin as maintainer
Artturin 944781b
gobject-introspection: revert patch to ignore return codes from ldd
Artturin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
pkgs/development/libraries/gobject-introspection/wrapper.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| { lib | ||
| , stdenv | ||
| , buildPackages | ||
| , gobject-introspection-unwrapped | ||
| , targetPackages | ||
| }: | ||
|
|
||
| # to build, run | ||
| # `nix build ".#pkgsCross.aarch64-multiplatform.buildPackages.gobject-introspection"` | ||
| gobject-introspection-unwrapped.overrideAttrs (_previousAttrs: { | ||
| pname = "gobject-introspection-wrapped"; | ||
| postFixup = '' | ||
| mv $dev/bin/g-ir-compiler $dev/bin/.g-ir-compiler-wrapped | ||
| mv $dev/bin/g-ir-scanner $dev/bin/.g-ir-scanner-wrapped | ||
|
|
||
| ( | ||
| export bash="${buildPackages.bash}/bin/bash" | ||
| export emulator=${lib.escapeShellArg (stdenv.targetPlatform.emulator buildPackages)} | ||
| export buildprelink="${buildPackages.prelink}/bin/prelink-rtld" | ||
|
|
||
| export targetgir="${lib.getDev targetPackages.gobject-introspection-unwrapped}" | ||
|
|
||
| substituteAll "${./wrappers/g-ir-compiler.sh}" "$dev/bin/g-ir-compiler" | ||
| substituteAll "${./wrappers/g-ir-scanner.sh}" "$dev/bin/g-ir-scanner" | ||
| chmod +x "$dev/bin/g-ir-compiler" | ||
| chmod +x "$dev/bin/g-ir-scanner" | ||
| ) | ||
| ''; | ||
| }) | ||
4 changes: 4 additions & 0 deletions
4
pkgs/development/libraries/gobject-introspection/wrappers/g-ir-compiler.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #! @bash@ | ||
| # shellcheck shell=bash | ||
|
|
||
| exec @emulator@ @targetgir@/bin/g-ir-compiler "$@" |
7 changes: 7 additions & 0 deletions
7
pkgs/development/libraries/gobject-introspection/wrappers/g-ir-scanner.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| #! @bash@ | ||
| # shellcheck shell=bash | ||
|
|
||
| exec @dev@/bin/.g-ir-scanner-wrapped \ | ||
| --use-binary-wrapper=@emulator@ \ | ||
| --use-ldd-wrapper=@buildprelink@ \ | ||
| "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| add_meson_exe_wrapper_cross_flag() { | ||
| mesonFlagsArray+=(--cross-file=@crossFile@) | ||
| } | ||
|
|
||
| preConfigureHooks+=(add_meson_exe_wrapper_cross_flag) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,54 @@ | ||
| { lib, stdenv, fetchurl, libelf }: | ||
| { stdenv | ||
| , lib | ||
| , fetchgit | ||
| , autoreconfHook | ||
| , libelf | ||
| , libiberty | ||
| }: | ||
|
|
||
| stdenv.mkDerivation rec { | ||
| pname = "prelink"; | ||
| version = "20130503"; | ||
| version = "unstable-2019-06-24"; | ||
|
|
||
| src = fetchgit { | ||
| url = "https://git.yoctoproject.org/git/prelink-cross"; | ||
| branchName = "cross_prelink"; | ||
| rev = "f9975537dbfd9ade0fc813bd5cf5fcbe41753a37"; | ||
| sha256 = "sha256-O9/oZooLRyUBBZX3SFcB6LFMmi2vQqkUlqtZnrq5oZc="; | ||
| }; | ||
|
|
||
| strictDeps = true; | ||
|
|
||
| configurePlatforms = [ "build" "host" ]; | ||
|
|
||
| nativeBuildInputs = [ | ||
| autoreconfHook | ||
| ]; | ||
|
|
||
| buildInputs = [ | ||
| libelf stdenv.cc.libc (lib.getOutput "static" stdenv.cc.libc) | ||
| stdenv.cc.libc | ||
| libelf | ||
| libiberty | ||
| ]; | ||
|
|
||
| src = fetchurl { | ||
| url = "https://people.redhat.com/jakub/prelink/prelink-${version}.tar.bz2"; | ||
| sha256 = "1w20f6ilqrz8ca51qhrn1n13h7q1r34k09g33d6l2vwvbrhcffb3"; | ||
| }; | ||
| # Disable some tests because they're failing | ||
| preCheck = '' | ||
| for f in reloc2 layout1 unprel1 tls3 cxx2 cxx3 quick1 quick2 deps1 deps2; do | ||
Artturin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo '#' > testsuite/''${f}.sh | ||
| done | ||
| patchShebangs --build testsuite | ||
| ''; | ||
|
|
||
| # most tests fail | ||
| doCheck = !stdenv.isAarch64; | ||
|
|
||
| enableParallelBuilding = true; | ||
|
|
||
| meta = { | ||
| homepage = "https://people.redhat.com/jakub/prelink/"; | ||
| license = "GPL"; | ||
| meta = with lib;{ | ||
| description = "ELF prelinking utility to speed up dynamic linking"; | ||
| platforms = lib.platforms.linux; | ||
| homepage = "https://wiki.yoctoproject.org/wiki/Cross-Prelink"; | ||
| license = licenses.gpl2Plus; | ||
| platforms = platforms.linux; | ||
| maintainers = with maintainers; [ artturin ]; | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.