Navigation Menu

Skip to content
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

sublimeMerge: init at 1058 #47378

Closed
wants to merge 2 commits into from
Closed

sublimeMerge: init at 1058 #47378

wants to merge 2 commits into from

Conversation

jonoabroad
Copy link

@jonoabroad jonoabroad commented Sep 26, 2018

Motivation for this change

Provide git client Sublime Merge addressing #47377

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@@ -18806,6 +18806,10 @@ with pkgs;
pythonBindings = true;
});

sublimeMergePackages = recurseIntoAttrs (callPackage ../development/tools/sublime-merge/packages.nix { });

sublimeMerge = sublimeMergePackages.sublimeMerge;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use inherit?

Copy link
Author

Choose a reason for hiding this comment

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

fixing other comments, I'll explain this one though - this is a copy of the sublime text 3 package with as minimal changes as necessary to get it working.

homepage = https://www.sublimemerge.com/;
maintainers = with maintainers; [ jonoabroad ];
license = licenses.unfree;
platforms = [ "x86_64-linux" "i686-linux" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

There are only 64 bit binaries.

done

# Rewrite pkexec|gksudo argument. Note that we can't delete bytes in binary.
sed -i -e 's,/bin/cp\x00,cp\x00\x00\x00\x00\x00\x00,g' sublime_merge
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not seem to be necessary.

installPhase = ''
mkdir -p $out/bin

cat > $out/bin/sublM <<-EOF
Copy link
Contributor

Choose a reason for hiding this comment

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

The short name is smerge not sublM, see the debian package.

buildVersion = "1058";
x64sha256 = "1yj3cg3z9421h36mgjprr94p4m0i4hl4ndi215bfp1i1b02rrva8";
} {};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing \n on the last line.

@jtojnar
Copy link
Contributor

jtojnar commented Sep 26, 2018

Could you add dev builds as well? https://forum.sublimetext.com/t/sublime-merge-dev-build-1060/39348

 - short name smerge rather than sublM,
 - only support 64bit,
 - add current dev build,
 - remove unneeded rewrite.
# when trying to run a build from within Sublime Merge
ln -s ${bash}/bin/bash $out/sublime_bash
wrapProgram $out/sublime_bash \
--set LD_PRELOAD "${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1"
Copy link
Member

Choose a reason for hiding this comment

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

This is weird so. Does it not like libredirect? You could use makeWrapper to create sublime_bash directly instead of having the symlink first.

#!/bin/sh
exec $sublimeMerge/sublime_merge "\$@"
EOF
chmod +x $out/bin/smerge
Copy link
Member

Choose a reason for hiding this comment

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

This is a job for makeWrapper.

chmod +x $out/bin/smerge

ln $out/bin/smerge $out/bin/sublime_merge
ln $out/bin/smerge $out/bin/sublimeMerge
Copy link
Member

@Mic92 Mic92 Sep 26, 2018

Choose a reason for hiding this comment

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

Why not just wrap to $out/bin/sublime_merge directly and then do the hard link?


libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk2 cairo pango];
redirects = [ "/usr/bin/pkexec=${pkexecPath}" ]
++ stdenv.lib.optional gksuSupport "/usr/bin/gksudo=${gksu}/bin/gksudo";
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can convince upstream to not use absolute paths here.

Copy link
Member

Choose a reason for hiding this comment

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

Is the sublime forum the right place to ask? @guillermooo

Copy link
Member

Choose a reason for hiding this comment

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

@@ -18786,6 +18786,13 @@ with pkgs;

sublime3-dev = sublime3Packages.sublime3-dev;

sublimeMergePackages = recurseIntoAttrs (callPackage ../development/tools/sublime-merge/packages.nix { });

sublimeMerge = sublimeMergePackages.sublimeMerge;
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do inherit (sublimeMergePackages) sublimeMerge sublimeMerge-dev;

Copy link
Author

Choose a reason for hiding this comment

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

Oh, that is much nicer.

Copy link
Member

@ryantm ryantm left a comment

Choose a reason for hiding this comment

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

Please address the other review comments.

@jtojnar
Copy link
Contributor

jtojnar commented Mar 9, 2019

Sublime Text now has updateScript, it would be nice to add it here as well.

@worldofpeace
Copy link
Contributor

closing in favor of #58994

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants