Skip to content

Commit

Permalink
pyproject.nix pkg, all pkgs rewritten
Browse files Browse the repository at this point in the history
  • Loading branch information
TyberiusPrime committed Sep 27, 2024
1 parent 1320f6e commit 2fd03a3
Show file tree
Hide file tree
Showing 2,853 changed files with 7,807 additions and 6,943 deletions.
4 changes: 1 addition & 3 deletions manual_overrides/angr/9.2.117/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
libs = "${final.pyvex}/lib/python3.10/site-packages/pyvex/lib";
}
{ libs = "${final.pyvex}/lib/python3.10/site-packages/pyvex/lib"; }
6 changes: 3 additions & 3 deletions manual_overrides/annoy/1.17.3/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
postPatch = ''
cat setup.py
substituteInPlace "setup.py" \
--replace-fail "'nose>=1.0'" ""
cat setup.py
substituteInPlace "setup.py" \
--replace-fail "'nose>=1.0'" ""
'';
}
11 changes: 4 additions & 7 deletions manual_overrides/bwapy/0.1.4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
--replace-quiet 'setuptools>=49.2.0' 'setuptools'
'';

buildInputs =
old.buildInputs
or []
++ [
pkgs.zlib
pkgs.bwa
];
buildInputs = old.buildInputs or [ ] ++ [
pkgs.zlib
pkgs.bwa
];
}
3 changes: 1 addition & 2 deletions manual_overrides/keyutils/0.6/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
# from nixpkgs
postPatch = ''
postPatch = ''
substituteInPlace setup.py --replace '"pytest-runner"' ""
'';

Expand All @@ -14,4 +14,3 @@

buildInputs = [ pkgs.keyutils ];
}

2 changes: 1 addition & 1 deletion manual_overrides/psycopg2/2.9.9/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
PGDATABASE = "psycopg2_test";
};

buildInputs = [pkgs.postgresql] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [pkgs.openssl];
buildInputs = [ pkgs.postgresql ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.openssl ];
}
33 changes: 18 additions & 15 deletions manual_overrides/pyeclib/1.6.1/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
let
liberasurecode = pkgs.liberasurecode;
stdenv = pkgs.stdenv;
lib = pkgs.lib;
in {
buildInputs = [pkgs.liberasurecode final.setuptools];
nativeBuildInputs = [pkgs.liberasurecode.dev];
inherit (pkgs) liberasurecode;
inherit (pkgs) stdenv;
inherit (pkgs) lib;
in
{
buildInputs = [
pkgs.liberasurecode
final.setuptools
];
nativeBuildInputs = [ pkgs.liberasurecode.dev ];
# from nixpkgs
postPatch = ''
# patch dlopen call
Expand All @@ -14,13 +18,12 @@ in {
substituteInPlace setup.py \
--replace '"Darwin"' '"macOS"'
'';
preBuild = let
ldLibraryPathEnvName =
if stdenv.isDarwin
then "DYLD_LIBRARY_PATH"
else "LD_LIBRARY_PATH";
in ''
# required for the custom _find_library function in setup.py
export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [liberasurecode]}"
'';
preBuild =
let
ldLibraryPathEnvName = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
in
''
# required for the custom _find_library function in setup.py
export ${ldLibraryPathEnvName}="${lib.makeLibraryPath [ liberasurecode ]}"
'';
}
22 changes: 12 additions & 10 deletions manual_overrides/pyqt5-qt5/5.15.15/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
let
lib = pkgs.lib;
selectQt5 = version: let
selector = builtins.concatStringsSep "" (lib.take 2 (builtins.splitVersion version));
in
inherit (pkgs) lib;
selectQt5 =
version:
let
selector = builtins.concatStringsSep "" (lib.take 2 (builtins.splitVersion version));
in
pkgs."qt${selector}" or pkgs.qt5;

qt5 = selectQt5 prev.pyqt5-qt5.version;
pyQt5Modules = qt5:
with qt5; [
pyQt5Modules =
qt5: with qt5; [
qt3d
qtbase
qtcharts
Expand All @@ -26,17 +28,17 @@ let
qtx11extras
qtxmlpatterns
];
in {
in
{
dontWrapQtApps = true;
propagatedBuildInputs =
old.propagatedBuildInputs
or []
old.propagatedBuildInputs or [ ]
++ pyQt5Modules qt5
++ [
pkgs.gtk3
pkgs.speechd
pkgs.postgresql
pkgs.unixODBC
];
autoPatchelfIgnoreMissingDeps = ["libQt5Bodymovin.so.5"]; # no clue if this is correct.
autoPatchelfIgnoreMissingDeps = [ "libQt5Bodymovin.so.5" ]; # no clue if this is correct.
}
24 changes: 13 additions & 11 deletions manual_overrides/pyqt5/5.15.11/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
let
lib = pkgs.lib;
selectQt5 = version: let
selector = builtins.concatStringsSep "" (lib.take 2 (builtins.splitVersion version));
in
inherit (pkgs) lib;
selectQt5 =
version:
let
selector = builtins.concatStringsSep "" (lib.take 2 (builtins.splitVersion version));
in
pkgs."qt${selector}" or pkgs.qt5;

qt5 = selectQt5 prev.pyqt5-qt5.version;
pyQt5Modules = qt5:
with qt5; [
pyQt5Modules =
qt5: with qt5; [
qt3d
qtbase
qtcharts
Expand All @@ -30,7 +32,8 @@ let
qttools

];
in {
in
{
postPatch = ''
# Confirm license, if project.py exists
if test -f project.py; then
Expand All @@ -41,13 +44,12 @@ in {
dontConfigure = true;
dontWrapQtApps = true;
nativeBuildInputs =
old.nativeBuildInputs
or []
old.nativeBuildInputs or [ ]
++ pyQt5Modules qt5
++ [
final.pyqt-builder
final.sip
];
buildInputs = old.buildInputs or [] ++ pyQt5Modules qt5;
autoPatchelfIgnoreMissingDeps = ["libQt5TextToSpeech.so.5"]; # no clue if this is correct.
buildInputs = old.buildInputs or [ ] ++ pyQt5Modules qt5;
autoPatchelfIgnoreMissingDeps = [ "libQt5TextToSpeech.so.5" ]; # no clue if this is correct.
}
17 changes: 10 additions & 7 deletions manual_overrides/python-augeas/1.1.0/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
postPatch = let
libname = "libaugeas${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}";
in old.postPatch or "" + ''
substituteInPlace augeas/ffi.py \
--replace-fail 'ffi.dlopen("augeas")' \
'ffi.dlopen("${pkgs.lib.makeLibraryPath [pkgs.augeas]}/${libname}")'
'';
postPatch =
let
libname = "libaugeas${pkgs.stdenv.hostPlatform.extensions.sharedLibrary}";
in
old.postPatch or ""
+ ''
substituteInPlace augeas/ffi.py \
--replace-fail 'ffi.dlopen("augeas")' \
'ffi.dlopen("${pkgs.lib.makeLibraryPath [ pkgs.augeas ]}/${libname}")'
'';
}
5 changes: 3 additions & 2 deletions manual_overrides/pywlroots/0.17.0/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
with pkgs; {
nativeBuildInputs = [pkg-config];
with pkgs;
{
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libinput
libxkbcommon
Expand Down
4 changes: 1 addition & 3 deletions manual_overrides/ropper/1.13.8/default.nix
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
{
propagatedBuildInputs = [final.capstone];
}
{ propagatedBuildInputs = [ final.capstone ]; }
2 changes: 1 addition & 1 deletion manual_overrides/umi-tools/1.1.5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
preBuild = pkgs.lib.optionals (final.python.pythonAtLeast "3.12") ''
${final.cython}/bin/cython umi_tools/_dedup_umi.pyx
'';
buildInputs = old.buildInputs or [] ++ [final.pysam];
buildInputs = old.buildInputs or [ ] ++ [ final.pysam ];
}
20 changes: 12 additions & 8 deletions manual_overrides/wxpython/4.2.1/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
let
localPython = final.python.withPackages (ps:
with ps; [
localPython = final.python.withPackages (
ps: with ps; [
setuptools
numpy
six
]);
in {
]
);
in
{
pythonOutputDistPhase = ":";

DOXYGEN = "${pkgs.doxygen}/bin/doxygen";

nativeBuildInputs = with pkgs;
nativeBuildInputs =
with pkgs;
[
which
doxygen
Expand All @@ -19,9 +22,10 @@ in {
autoPatchelfHook
final.sip
]
++ old.nativeBuildInputs or [];
++ old.nativeBuildInputs or [ ];

buildInputs = with pkgs;
buildInputs =
with pkgs;
[
gtk3
webkitgtk
Expand All @@ -39,7 +43,7 @@ in {
libglvnd
mesa
]
++ old.buildInputs or [];
++ old.buildInputs or [ ];

buildPhase = ''
${localPython.interpreter} build.py -v build_wx
Expand Down
2 changes: 1 addition & 1 deletion manual_overrides/xkbcommon/1.5.1/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{

postBuild = ''
${prev.python}/bin/python xkbcommon/ffi_build.py
'';
Expand Down
79 changes: 79 additions & 0 deletions non_working_overrides/pygame/2.1.3/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
with pkgs;
rec {
patches = [
# Patch pygame's dependency resolution to let it find build inputs
(pkgs.substituteAll {
src = ./fix-dependency-finding.patch;
buildinputs_include = builtins.toJSON (
builtins.concatMap (dep: [
"${lib.getDev dep}/"
"${lib.getDev dep}/include"
"${lib.getDev dep}/include/SDL2"
]) buildInputs
);
buildinputs_lib = builtins.toJSON (
builtins.concatMap (dep: [
"${lib.getLib dep}/"
"${lib.getLib dep}/lib"
]) buildInputs
);
})
# Skip tests that should be disabled without video driver
./skip-surface-tests.patch

# removes distutils unbreaking py312, part of https://github.com/pygame/pygame/pull/4211
# (fetchpatch {
# name = "remove-distutils.patch";
# url = "https://github.com/pygame/pygame/commit/6038e7d6583a7a25fcc6e15387cf6240e427e5a7.patch";
# hash = "sha256-HxcYjjhsu/Y9HiK9xDvY4X5dgWPP4XFLxdYGXC6tdWM=";
# })
];

postPatch = ''
substituteInPlace src_py/sysfont.py \
--replace-fail 'path="fc-list"' 'path="${fontconfig}/bin/fc-list"' \
--replace-fail /usr/X11/bin/fc-list ${fontconfig}/bin/fc-list
'';

nativeBuildInputs = [
final.cython_0
pkgs.pkg-config
pkgs.SDL2
final.setuptools
];

buildInputs =
with pkgs;
[
freetype
libjpeg
libpng
xorg.libX11
portmidi
SDL2
SDL2_image
SDL2_mixer
SDL2_ttf
]
++ lib.optionals stdenv.isDarwin [ AppKit ];

preConfigure = ''
${prev.python}/bin/python buildconfig/config.py
'';

env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
};

# checkPhase = ''
# runHook preCheck

# # No audio or video device in test environment
# export SDL_VIDEODRIVER=dummy
# export SDL_AUDIODRIVER=disk

# ${final.python.interpreter} -m pygame.tests -v --exclude opengl,timing --time_out 300

# runHook postCheck
# '';
}
Loading

0 comments on commit 2fd03a3

Please sign in to comment.