about summary refs log tree commit diff
path: root/pkgs/development/misc
diff options
context:
space:
mode:
authorTravis A. Everett <travis.a.everett@gmail.com>2024-03-05 22:09:07 -0600
committerTravis A. Everett <travis.a.everett@gmail.com>2024-03-28 19:45:35 -0500
commit56d5b181c9f2bf748a44526f4db9861524e1dbb2 (patch)
treec7cfbc3ec63a8369c57e181ae4cf216b66d8eb3f /pkgs/development/misc
parent67d25591a0cb573bc5b2dd173a9d9099042f6909 (diff)
resholve: 0.9.1 -> 0.10.2, ongoing cross fixes
Diffstat (limited to 'pkgs/development/misc')
-rw-r--r--pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch42
-rw-r--r--pkgs/development/misc/resholve/README.md5
-rw-r--r--pkgs/development/misc/resholve/default.nix2
-rw-r--r--pkgs/development/misc/resholve/oildev.nix60
-rw-r--r--pkgs/development/misc/resholve/resholve.nix21
-rw-r--r--pkgs/development/misc/resholve/source.nix4
6 files changed, 44 insertions, 90 deletions
diff --git a/pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch b/pkgs/development/misc/resholve/0014-clang_incompatible_function_pointer_conversions.patch
deleted file mode 100644
index 52d5e6adfe74e..0000000000000
--- a/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/pkgs/development/misc/resholve/README.md b/pkgs/development/misc/resholve/README.md
index 439e4ea8188d0..6538b5921af3e 100644
--- a/pkgs/development/misc/resholve/README.md
+++ b/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/pkgs/development/misc/resholve/default.nix b/pkgs/development/misc/resholve/default.nix
index 8499ba7553da5..13fd7a9adecc4 100644
--- a/pkgs/development/misc/resholve/default.nix
+++ b/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/pkgs/development/misc/resholve/oildev.nix b/pkgs/development/misc/resholve/oildev.nix
index 767cedee3913f..c770fb894a3b0 100644
--- a/pkgs/development/misc/resholve/oildev.nix
+++ b/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/pkgs/development/misc/resholve/resholve.nix b/pkgs/development/misc/resholve/resholve.nix
index 28a0e401cf5dd..5c7984b66d223 100644
--- a/pkgs/development/misc/resholve/resholve.nix
+++ b/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/pkgs/development/misc/resholve/source.nix b/pkgs/development/misc/resholve/source.nix
index 5e74bdc06acce..1492e3685779c 100644
--- a/pkgs/development/misc/resholve/source.nix
+++ b/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=";
   };
 }