-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix proxychains ld flags #20355
fix proxychains ld flags #20355
Conversation
Thiis issue is fixed in proxychains with this commit 4 years ago. But there's no release since then. I'm not sure this is the right way, anyway, I post a simple patch here. |
You can fetch an individual commit as a patch. Whether it'll apply is another matter :) |
@joachifm |
It's not any different than using your own patch, if they both do the same thing and both apply to the same base. In that scenario, the commit doesn't need a version number any more (or less, I suppose) than your patch does. |
Sorry for the late reply. I tried using the specific commit as a patch. It does not work as expected for me. b/pkgs/tools/networking/proxychains/default.nix
index ed19f9d..75acf23 100644
--- a/pkgs/tools/networking/proxychains/default.nix
+++ b/pkgs/tools/networking/proxychains/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub } :
+{ stdenv, fetchpatch, fetchFromGitHub } :
stdenv.mkDerivation rec {
name = "proxychains-${version}";
version = "4.2.0";
@@ -16,4 +16,12 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.linux;
};
+
+ patches = [
+ (fetchpatch { /* glibmm 2.50 fix */
+ url = https://github.com/haad/proxychains/commit/fb30a834a797c7e1a924f46d6746f3c230298e1d.patch;
+ sha256 = "1viwqm8bd0q696kfr6wjzv2hca25inxw727cyapsjffi1scq6d9c";
+ })
+ ];
+
} Got an error here
|
@roxma if the upstream patch fails to apply, we can use yours until a new release is made. I believe your original patch easily reduces to a single sed call, however, please consider doing that instead; it's fairly common to do ad-hoc patching like this inline in Nixpkgs. |
I just updated the PR, I pull all the commits as patch on the ==== diff --git a/pkgs/tools/networking/proxychains/default.nix b/pkgs/tools/networking/proxychains/default.nix
index ed19f9d..f40a392 100644
--- a/pkgs/tools/networking/proxychains/default.nix
+++ b/pkgs/tools/networking/proxychains/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub } :
+{ stdenv, fetchpatch, fetchFromGitHub } :
stdenv.mkDerivation rec {
name = "proxychains-${version}";
version = "4.2.0";
@@ -16,4 +16,37 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.linux;
};
+
+ patches = [
+
+ /* fix ld flags */
+
+ /* Fix library settings. */
+ (fetchpatch {
+ url = https://github.com/haad/proxychains/commit/2eb641758ba15d9f931e6b599ef14523d5ebf6d5.patch;
+ sha256 = "1rzwg7vrrlpjf0s4m5gbzfhb75ahwcm2m9x4l7w3n92gfzb066b5";
+ })
+ /* Add OS specific LD, C flags this enables use to use -pthread and -lpt… */
+ (fetchpatch {
+ url = https://github.com/haad/proxychains/commit/fb30a834a797c7e1a924f46d6746f3c230298e1d.patch;
+ sha256 = "1viwqm8bd0q696kfr6wjzv2hca25inxw727cyapsjffi1scq6d9c";
+ })
+ /* Use same LD parameters where is it possible. */
+ (fetchpatch {
+ url = https://github.com/haad/proxychains/commit/93bbad6ccbe6006a909c094e22569a9ed2d207fa.patch;
+ sha256 = "05vvwa5whi34l8wbzkhhqyfss5xh0f9gbw8859c7592n069875ib";
+ })
+ /* Make linux and mac options similar.*/
+ (fetchpatch {
+ url = https://github.com/haad/proxychains/commit/dcbafb0279a5e0e4dc1055afb533d3909327b6bb.patch;
+ sha256 = "1ydicfja68z984pqqh90689cacv8xyfr935h1qh40xbbsd84vd44";
+ })
+ /* Fix Linux compile issue */
+ (fetchpatch {
+ url = https://github.com/haad/proxychains/commit/86dfc828f196c255a18d6730cd16816b35e2fbaf.patch;
+ sha256 = "1113yjwyj17kfq23aw4gk9vaw8m47l2n45ffj8chlis8wyqphm8g";
+ })
+
+ ];
+
}
|
I can use a sed call if you prefer that way. Is there any example I can refer to? |
OK. I'm using sed now, It looks simpler. ==== diff --git a/pkgs/tools/networking/proxychains/default.nix b/pkgs/tools/networking/proxychains/default.nix
index ed19f9d..0c6df85 100644
--- a/pkgs/tools/networking/proxychains/default.nix
+++ b/pkgs/tools/networking/proxychains/default.nix
@@ -16,4 +16,10 @@ stdenv.mkDerivation rec {
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.linux;
};
+
+ preConfigure = ''
+ # patch, add -ldl flag
+ sed -i Makefile -e '/-lpthread/a LDFLAGS+=-ldl'
+ '';
+
} |
By the way, I found proxychains-ng and It looks more well-maintained. Maybe It's worth to create another package for this. |
Merged. Thank you |
Withou the patch, I got an error with
proxychains4 git submodule add ...
Using the patch: