about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/misc/resholve
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-05-03 15:14:25 +0200
committerAlyssa Ross <hi@alyssa.is>2024-05-07 11:19:19 +0200
commitd92b2b6a1bbd322dd65a8b6f51019610d350046e (patch)
tree7f7c21927b9cc05676501f297c51eb76b49e326c /nixpkgs/pkgs/development/misc/resholve
parent93c9e56b40530cc627d921cfc255c05b495d4017 (diff)
parent49050352f602fe87d16ff7b2b6a05b79eb20dc6f (diff)
downloadnixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.gz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.bz2
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.lz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.xz
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.tar.zst
nixlib-d92b2b6a1bbd322dd65a8b6f51019610d350046e.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable-small'
Conflicts:
	nixpkgs/nixos/modules/services/mail/mailman.nix
	nixpkgs/nixos/modules/services/mail/public-inbox.nix
	nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/development/misc/resholve')
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch42
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/README.md5
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/default.nix2
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/oildev.nix60
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/resholve.nix21
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/source.nix4
-rw-r--r--nixpkgs/pkgs/development/misc/resholve/test.nix16
7 files changed, 60 insertions, 90 deletions
diff --git a/nixpkgs/pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch b/nixpkgs/pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch
deleted file mode 100644
index 52d5e6adfe74..000000000000
--- a/nixpkgs/pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff -ur a/decoder.c b/decoder.c
---- a/decoder.c	1980-01-02 00:00:00.000000000 -0500
-+++ b/decoder.c	2023-11-08 17:42:43.981838074 -0500
-@@ -94,7 +94,7 @@
-     return PlaceObject(ctx, PyBool_FromLong((long)(value)));
- }
- 
--static int handle_number(void *ctx, const char *value, unsigned int length)
-+static int handle_number(void *ctx, const char *value, size_t length)
- {
-     //fprintf(stderr, "handle_number: ");
-     //fwrite(value, length, 1, stderr);
-@@ -127,7 +127,7 @@
-     return status;
- }
- 
--static int handle_string(void *ctx, const unsigned char *value, unsigned int length)
-+static int handle_string(void *ctx, const unsigned char *value, size_t length)
- {
-     return PlaceObject(ctx, PyString_FromStringAndSize((char *)value, length));
- }
-@@ -142,7 +142,7 @@
-     return success;
- }
- 
--static int handle_dict_key(void *ctx, const unsigned char *value, unsigned int length)
-+static int handle_dict_key(void *ctx, const unsigned char *value, size_t length)
- {
-     PyObject *object = PyString_FromStringAndSize((const char *) value, length);
- 
-diff -ur a/yajl.c b/yajl.c
---- a/yajl.c	1980-01-02 00:00:00.000000000 -0500
-+++ b/yajl.c	2023-11-08 17:41:18.781350335 -0500
-@@ -161,7 +161,7 @@
- }
- 
- static struct PyMethodDef yajl_methods[] = {
--    {"dumps", (PyCFunctionWithKeywords)(py_dumps), METH_VARARGS | METH_KEYWORDS,
-+    {"dumps", (PyCFunction)(py_dumps), METH_VARARGS | METH_KEYWORDS,
- "yajl.dumps(obj [, indent=None])\n\n\
- Returns an encoded JSON string of the specified `obj`\n\
- \n\
diff --git a/nixpkgs/pkgs/development/misc/resholve/README.md b/nixpkgs/pkgs/development/misc/resholve/README.md
index 0e875a765658..734ff26d8c4e 100644
--- a/nixpkgs/pkgs/development/misc/resholve/README.md
+++ b/nixpkgs/pkgs/development/misc/resholve/README.md
@@ -52,13 +52,13 @@ Here's a simple example of how `resholve.mkDerivation` is already used in nixpkg
 
 resholve.mkDerivation rec {
   pname = "dgoss";
-  version = "0.4.1";
+  version = "0.4.2";
 
   src = fetchFromGitHub {
     owner = "goss-org";
     repo = "goss";
     rev = "refs/tags/v${version}";
-    hash = "sha256-dpMTUBMEG5tDi7E6ZRg1KHqIj5qDlvwfwJEgq/5z7RE=";
+    hash = "sha256-FDn1OETkYIpMenk8QAAHvfNZcSzqGl5xrD0fAZPVmRM=";
   };
 
   dontConfigure = true;
@@ -87,6 +87,7 @@ resholve.mkDerivation rec {
     license = licenses.asl20;
     platforms = platforms.linux;
     maintainers = with maintainers; [ hyzual anthonyroussel ];
+    mainProgram = "dgoss";
   };
 }
 ```
diff --git a/nixpkgs/pkgs/development/misc/resholve/default.nix b/nixpkgs/pkgs/development/misc/resholve/default.nix
index 8499ba7553da..13fd7a9adecc 100644
--- a/nixpkgs/pkgs/development/misc/resholve/default.nix
+++ b/nixpkgs/pkgs/development/misc/resholve/default.nix
@@ -28,7 +28,7 @@ let
     stripTests = true;
     enableOptimizations = false;
   };
-  callPackage = lib.callPackageWith (pkgs // { python27 = python27'; });
+  callPackage = lib.callPackageWith (pkgsBuildHost // { python27 = python27'; });
   source = callPackage ./source.nix { };
   deps = callPackage ./deps.nix { };
 in
diff --git a/nixpkgs/pkgs/development/misc/resholve/oildev.nix b/nixpkgs/pkgs/development/misc/resholve/oildev.nix
index 767cedee3913..c770fb894a3b 100644
--- a/nixpkgs/pkgs/development/misc/resholve/oildev.nix
+++ b/nixpkgs/pkgs/development/misc/resholve/oildev.nix
@@ -4,35 +4,15 @@
 , callPackage
 , fetchFromGitHub
 , makeWrapper
-, # py-yajl deps
-  git
-, # oil deps
-  pkgsBuildBuild
 , re2c
+, # oil deps
+  glibcLocales
 , file
 , six
 , typing
 }:
 
 rec {
-  py-yajl = python27.pkgs.buildPythonPackage rec {
-    pname = "oil-pyyajl-unstable";
-    version = "2022-09-01";
-    src = fetchFromGitHub {
-      owner = "oilshell";
-      repo = "py-yajl";
-      rev = "72686b0e2e9d13d3ce5fefe47ecd607c540c90a3";
-      hash = "sha256-H3GKN0Pq1VFD5+SWxm8CXUVO7zAyj/ngKVmDaG/aRT4=";
-      fetchSubmodules = true;
-    };
-    patches = [
-      # Fixes several incompatible function pointer conversions, which are errors in clang 16.
-      ./0014-clang_incompatible_function_pointer_conversions.patch
-    ];
-    # just for submodule IIRC
-    nativeBuildInputs = [ git ];
-  };
-
   /*
     Upstream isn't interested in packaging this as a library
     (or accepting all of the patches we need to do so).
@@ -40,14 +20,14 @@ rec {
   */
   oildev = python27.pkgs.buildPythonPackage rec {
     pname = "oildev-unstable";
-    version = "2021-07-14";
+    version = "2024-02-26";
 
     src = fetchFromGitHub {
       owner = "oilshell";
       repo = "oil";
-      # rev == present HEAD of release/0.14.0
-      rev = "3d0427e222f7e42ae7be90c706d7fde555efca2e";
-      hash = "sha256-XMoNkBEEmD6AwNSu1uSh3OcWLfy4/ADtRckn/Pj2cP4=";
+      # rev == present HEAD of release/0.20.0
+      rev = "f730c79e2dcde4bc08e85a718951cfa42102bd01";
+      hash = "sha256-HBj3Izh1gD63EzbgZ/9If5vihR5L2HhnyCyMah6rMg4=";
 
       /*
         It's not critical to drop most of these; the primary target is
@@ -58,7 +38,7 @@ rec {
         hash on rev updates. Command will fail w/o and not print hash.
       */
       postFetch = ''
-        rm -rf $out/{Python-2.7.13,metrics,py-yajl,rfc,gold,web,testdata,services,demo,devtools}
+        rm -rf $out/{Python-2.7.13,metrics,py-yajl,rfc,gold,web,testdata,services,demo}
       '';
     };
 
@@ -66,13 +46,13 @@ rec {
     patchSrc = fetchFromGitHub {
       owner = "abathur";
       repo = "nix-py-dev-oil";
-      rev = "v0.14.0.1";
-      hash = "sha256-47+986+SohdtoNzTYAgF2vPPWgakyg0VCmR+MgxMzTk=";
+      rev = "v0.20.0.0";
+      hash = "sha256-qoA54rnzAdnFZ3k4kRzQWEdgtEjraCT5+NFw8AWnRDk=";
     };
+
     patches = [
       "${patchSrc}/0001-add_setup_py.patch"
       "${patchSrc}/0002-add_MANIFEST_in.patch"
-      "${patchSrc}/0004-disable-internal-py-yajl-for-nix-built.patch"
       "${patchSrc}/0006-disable_failing_libc_tests.patch"
       "${patchSrc}/0007-namespace_via_init.patch"
       "${patchSrc}/0009-avoid_nix_arch64_darwin_toolchain_bug.patch"
@@ -80,37 +60,32 @@ rec {
       "${patchSrc}/0011-disable-fanos.patch"
       "${patchSrc}/0012-disable-doc-cmark.patch"
       "${patchSrc}/0013-fix-pyverify.patch"
+      "${patchSrc}/0015-fix-compiled-extension-import-paths.patch"
     ];
 
     configureFlags = [
       "--without-readline"
     ];
 
-    depsBuildBuild = [ re2c ];
-
-    nativeBuildInputs = [ file makeWrapper ];
+    nativeBuildInputs = [ re2c file makeWrapper ];
 
-    propagatedBuildInputs = [ six typing py-yajl ];
+    propagatedBuildInputs = [ six typing ];
 
     doCheck = true;
 
     preBuild = ''
-      build/dev.sh all
+      build/py.sh all
     '';
 
     postPatch = ''
-      patchShebangs asdl build core doctools frontend pyext oil_lang
-      substituteInPlace pyext/fastlex.c --replace '_gen/frontend' '../_gen/frontend'
-      substituteInPlace core/main_loop.py --replace 'import fanos' '# import fanos'
+      patchShebangs asdl build core doctools frontend pyext oil_lang ysh
       rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
       # work around hard parse failure documented in oilshell/oil#1468
       substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
-      # disable fragile libc tests
-      substituteInPlace build/py.sh --replace "py-ext-test pyext/libc_test.py" "#py-ext-test pyext/libc_test.py"
     '';
 
     # See earlier note on glibcLocales TODO: verify needed?
-    LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${pkgsBuildBuild.glibcLocales}/lib/locale/locale-archive";
+    LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
 
     # not exhaustive; sample what resholve uses as a sanity check
     pythonImportsCheck = [
@@ -121,7 +96,8 @@ rec {
       "oil._devbuild"
       "oil._devbuild.gen.id_kind_asdl"
       "oil._devbuild.gen.syntax_asdl"
-      "oil.tools.osh2oil"
+      "oil.osh"
+      "oil.tools.ysh_ify"
     ];
 
     meta = {
diff --git a/nixpkgs/pkgs/development/misc/resholve/resholve.nix b/nixpkgs/pkgs/development/misc/resholve/resholve.nix
index 28a0e401cf5d..5c7984b66d22 100644
--- a/nixpkgs/pkgs/development/misc/resholve/resholve.nix
+++ b/nixpkgs/pkgs/development/misc/resholve/resholve.nix
@@ -2,17 +2,31 @@
 , stdenv
 , callPackage
 , python27
+, fetchFromGitHub
 , installShellFiles
 , rSrc
 , version
 , oildev
 , configargparse
+, gawk
 , binlore
 , resholve
 , resholve-utils
 }:
 
-python27.pkgs.buildPythonApplication {
+let
+  sedparse = python27.pkgs.buildPythonPackage rec {
+    pname = "sedparse";
+    version = "0.1.2";
+    src = fetchFromGitHub {
+      owner = "aureliojargas";
+      repo = "sedparse";
+      rev = "0.1.2";
+      hash = "sha256-Q17A/oJ3GZbdSK55hPaMdw85g43WhTW9tuAuJtDfHHU=";
+    };
+  };
+
+in python27.pkgs.buildPythonApplication {
   pname = "resholve";
   inherit version;
   src = rSrc;
@@ -22,6 +36,11 @@ python27.pkgs.buildPythonApplication {
   propagatedBuildInputs = [
     oildev
     configargparse
+    sedparse
+  ];
+
+  makeWrapperArgs = [
+    "--prefix PATH : ${lib.makeBinPath [ gawk ]}"
   ];
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/development/misc/resholve/source.nix b/nixpkgs/pkgs/development/misc/resholve/source.nix
index 5e74bdc06acc..1492e3685779 100644
--- a/nixpkgs/pkgs/development/misc/resholve/source.nix
+++ b/nixpkgs/pkgs/development/misc/resholve/source.nix
@@ -3,11 +3,11 @@
 }:
 
 rec {
-  version = "0.9.1";
+  version = "0.10.2";
   rSrc = fetchFromGitHub {
     owner = "abathur";
     repo = "resholve";
     rev = "v${version}";
-    hash = "sha256-hkLKQKhEMD1UQ9EunPmx5Tsh44q4+tYj820OXF2ueUo=";
+    hash = "sha256-QXIX3Ai9HUFosvhfYTUJILZ588cvxTzULUUp1LYkQ0A=";
   };
 }
diff --git a/nixpkgs/pkgs/development/misc/resholve/test.nix b/nixpkgs/pkgs/development/misc/resholve/test.nix
index d9862bef7cf5..e9551b5be2a9 100644
--- a/nixpkgs/pkgs/development/misc/resholve/test.nix
+++ b/nixpkgs/pkgs/development/misc/resholve/test.nix
@@ -18,6 +18,7 @@
 , gettext
 , rSrc
 , runDemo ? false
+, fetchpatch
 , binlore
 , sqlite
 , unixtools
@@ -122,6 +123,21 @@ rec {
     name = "resholve-test";
     src = rSrc;
 
+    # TODO: should be removable on next resholve update--just
+    # temporarily work around test breaks caused by changes in
+    # bats 1.10.0. Since this is just about fixing tests, I'm
+    # patching test source to avoid going through staging.
+    patches = [
+      (fetchpatch {
+        url = "https://github.com/abathur/resholve/commit/e1d6ccbc9cd5ec26122997610954dcb7d826f652.patch";
+        hash = "sha256-XA9KUc/OAD2S8Vpt+C7KcjTP44rnZ4FLdgnnRqVWdWY=";
+      })
+      (fetchpatch {
+        url = "https://github.com/abathur/resholve/commit/50db1a6a97baa7d7543a8abe33dddda62b487c65.patch";
+        hash = "sha256-m1dKaLI02Wag7uacG4BkcdCXw30Kn6J4ydTqPd7bsak=";
+      })
+    ];
+
     dontBuild = true;
 
     installPhase = ''