Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/py-tools/meson.build b/py-tools/meson.build
index 2fff98d5..7784fffc 100644
--- a/py-tools/meson.build
+++ b/py-tools/meson.build
@@ -9,11 +9,7 @@ if with_doctool
tools += [['g-ir-doc-tool', 'docmain', 'doc_main']]
endif

-if cc.get_id() == 'msvc'
- python_cmd = '/usr/bin/env ' + python.path()
-else
- python_cmd = '/usr/bin/env python@0@'.format(python.language_version().split('.')[0])
-endif
+python_cmd = @python_bin@

tool_output = []
foreach tool : tools
80 changes: 68 additions & 12 deletions pkgs/development/libraries/gobject-introspection/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{ stdenv
, buildPackages
, fetchurl
, fetchFromGitLab
, glib
, flex
, bison
, makeSetupHook
, meson
, ninja
, gtk-doc
Expand All @@ -16,26 +19,52 @@
, cairo
, gnome3
, substituteAll
, writeText
, nixStoreDir ? builtins.storeDir
, x11Support ? true
, x11Support ? stdenv.buildPlatform == stdenv.hostPlatform
, build_library_and_c_tools ? true
, build_python_tools ? true
, gi_cross_use_prebuilt_gi ? false
, build_introspection_data ?
build_library_and_c_tools &&
(build_python_tools || gi_cross_use_prebuilt_gi)
, gobject-introspection-py-tools ? null
}:

# now that gobject-introspection creates large .gir files (eg gtk3 case)
# it may be worth thinking about using multiple derivation outputs
# In that case its about 6MB which could be separated

assert build_library_and_c_tools || build_python_tools;
assert build_introspection_data -> build_library_and_c_tools;
assert gi_cross_use_prebuilt_gi -> gobject-introspection-py-tools != null;

let
giSetupHook = makeSetupHook {
name = "gobject-introspection-hook";
} ./setup-hook.sh;
mkFlag = name: cond: "-D${name}=${if cond then "true" else "false"}";
in

stdenv.mkDerivation rec {
pname = "gobject-introspection";
version = "1.64.1";
version = "1.65-pre${stdenv.lib.strings.substring 0 7 src.rev}";

# outputs TODO: share/gobject-introspection-1.0/tests is needed during build
# by pygobject3 (and maybe others), but it's only searched in $out
outputs = [ "out" "dev" "devdoc" "man" ];
outputBin = "dev";

src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "19vz7vp10h0zj3f491yk72dp89bix6rgkzxg4qcm4d6151ksxgl0";
outputs = [ "out" ]
++ stdenv.lib.optionals build_library_and_c_tools [ "dev" "bin" ]
++ [ "devdoc" "man" ];

# Do not propogate the "bin" output, as it refers to the dev output.
propagatedBuildOutputs = stdenv.lib.optional build_library_and_c_tools "out";

src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "Ericson2314";
repo = "gobject-introspection";
rev = "d7a4fcb82957271f98b4492494a71cfaa8699c03";
sha256 = "0qnbld1k08c91zgvlasg38d7kidl7rr0drzd4dnyslj0vhssd5qz";
};

patches = [
Expand All @@ -45,6 +74,13 @@ stdenv.mkDerivation rec {
(substituteAll {
src = ./absolute_shlib_path.patch;
inherit nixStoreDir;
})
# We use this during the build, so patch shebangs in the fixed phase is too
# later. This is a template for string substitution so patch shebangs of
# the source is also too early.
(substituteAll {
src = ./absolute-python-shebang.patch;
python_bin = stdenv.lib.escapeShellArg python3.interpreter;
})
] ++ stdenv.lib.optionals x11Support [
# Hardcode the cairo shared library path in the Cairo gir shipped with this package.
Expand All @@ -66,11 +102,14 @@ stdenv.mkDerivation rec {
docbook_xml_dtd_43 # FIXME: remove in next release
docbook_xml_dtd_45
python3
setupHook # move .gir files
] ++ stdenv.lib.optionals (build_introspection_data && !gi_cross_use_prebuilt_gi) [
giSetupHook # move .gir files
];

buildInputs = [
python3
] ++ stdenv.lib.optionals gi_cross_use_prebuilt_gi [
gobject-introspection-py-tools
];

checkInputs = stdenv.lib.optionals stdenv.isDarwin [
Expand All @@ -82,12 +121,24 @@ stdenv.mkDerivation rec {
glib
];

strictDeps = true;

mesonFlags = [
"--datadir=${placeholder "dev"}/share"
"-Ddoctool=disabled"
"-Dcairo=disabled"
"-Dgtk_doc=true"
];
(mkFlag "build_library_and_c_tools" build_library_and_c_tools)
(mkFlag "build_python_tools" build_python_tools)
(mkFlag "gi_cross_use_prebuilt_gi" gi_cross_use_prebuilt_gi)
(mkFlag "build_introspection_data" build_introspection_data)
] ++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
("--cross-file=" + writeText "cross-file.conf" (''
[binaries]
exe_wrapper = ${stdenv.lib.escapeShellArg (stdenv.hostPlatform.emulator buildPackages)}
''))
"-Dgi_cross_ldd_wrapper=${buildPackages.prelink}/bin/prelink-rtld"
"-Dgi_cross_binary_wrapper=${stdenv.hostPlatform.emulator buildPackages}"
] ++ stdenv.lib.optional build_library_and_c_tools "--datadir=${placeholder "dev"}/share";

doCheck = !stdenv.isAarch64;

Expand All @@ -104,7 +155,12 @@ stdenv.mkDerivation rec {
rm $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary}
'';

setupHook = ./setup-hook.sh;
# Remove the bindir from the pkg-config file. We will add it back in a wrapper.
postInstall = stdenv.lib.optionalString build_library_and_c_tools ''
sed -i '/bindir/d' "$out/lib/pkgconfig"/*.pc
'';

setupHook = if build_python_tools then giSetupHook else null;

passthru = {
updateScript = gnome3.updateScript {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ make_gobject_introspection_find_gir_files() {
fi
}

addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files
addEnvHooks "$targetOffset" make_gobject_introspection_find_gir_files

giDiscoverSelf() {
if [ -d "$prefix/lib/girepository-1.0" ]; then
Expand Down
38 changes: 26 additions & 12 deletions pkgs/development/tools/misc/prelink/default.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
{ stdenv, fetchurl, libelf }:
{ stdenv, fetchgit, autoreconfHook
, libelf, libiberty
}:

let
version = "20130503";
in
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "prelink";
inherit version;
version = "2019-6-24-" + stdenv.lib.substring 0 7 src.rev;

src = fetchgit {
url = "https://git.yoctoproject.org/git/prelink-cross";
branchName = "cross_prelink";
rev = "f9975537dbfd9ade0fc813bd5cf5fcbe41753a37";
sha256 = "15x1p6x9wndbjqaajhmg5nd4rcg805blixwm0l0jaiqbi9kfiprv";
};

nativeBuildInputs = [
autoreconfHook
];

buildInputs = [
libelf stdenv.cc.libc (stdenv.lib.getOutput "static" stdenv.cc.libc)
stdenv.cc.libc (stdenv.lib.getOutput "static" stdenv.cc.libc)
libelf libiberty
];

src = fetchurl {
url = "https://people.redhat.com/jakub/prelink/prelink-${version}.tar.bz2";
sha256 = "1w20f6ilqrz8ca51qhrn1n13h7q1r34k09g33d6l2vwvbrhcffb3";
};
# There are some failures to investigate
doCheck = false;

preCheck = ''
patchShebangs --build testsuite
'';

meta = {
homepage = "https://people.redhat.com/jakub/prelink/";
homepage = "https://wiki.yoctoproject.org/wiki/Cross-Prelink";
#homepage = "https://people.redhat.com/jakub/prelink/";
license = "GPL";
description = "ELF prelinking utility to speed up dynamic linking";
platforms = stdenv.lib.platforms.linux;
Expand Down
13 changes: 12 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12047,11 +12047,22 @@ in
gns3-gui = gns3Packages.guiStable;
gns3-server = gns3Packages.serverStable;

gobject-introspection = callPackage ../development/libraries/gobject-introspection {
gobject-introspection-full-classic = callPackage ../development/libraries/gobject-introspection {
nixStoreDir = config.nix.storeDir or builtins.storeDir;
inherit (darwin) cctools;
};

gobject-introspection-py-tools = gobject-introspection-full-classic.override {
Copy link
Member

@Mic92 Mic92 May 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the when to use what? It's not clear from the commit message.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I think I'll need to make a wrapper package so this isn't actually used directly. But the idea is (whether directly or via some wrapper) than the py tools are need when generating new gir files and type libs when building some C library, and aren't needed by the programs in python etc that just consume typelibs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think we should make that distinction if it’s not made by gobject introspection. IIUC things that consume gir also produce gir without much distinction.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine, but we will need the wrapper anyways to combine the build platform py tools with host platform everything else.

build_python_tools = true;
build_library_and_c_tools = false;
};

gobject-introspection = gobject-introspection-full-classic.override {
build_python_tools = false;
build_library_and_c_tools = true;
gi_cross_use_prebuilt_gi = true;
};

goocanvas = callPackage ../development/libraries/goocanvas { };
goocanvas2 = callPackage ../development/libraries/goocanvas/2.x.nix { };
goocanvasmm2 = callPackage ../development/libraries/goocanvasmm { };
Expand Down