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

flameshot: init at 0.5.0 #34096

Merged
merged 1 commit into from Jan 28, 2018
Merged

flameshot: init at 0.5.0 #34096

merged 1 commit into from Jan 28, 2018

Conversation

scode
Copy link
Contributor

@scode scode commented Jan 21, 2018

Motivation for this change

flameshot is very useful, let's add it!

Things done

(tested on Ubuntu)

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/)
  • [x ] Fits CONTRIBUTING.md.

# flameshot.pro assumes qmake is being run in a git checkout and uses it
# to determine the version being built. Let's replace that.
"VERSION=${version}"
"PREFIX=/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cargo culted. Not sure if this is idiomatic.

sed -i 's,USRPATH = /usr/local,USRPATH = /,g' flameshot.pro
'';

installFlags = [ "INSTALL_ROOT=$(out)" ];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cargo culted. Not sure if this is idiomatic.

];
patchPhase = ''
sed -i 's/VERSION =/#VERSION =/g' flameshot.pro
sed -i 's,USRPATH = /usr/local,USRPATH = /,g' flameshot.pro
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feels ugly, but not sure if there's a cleaner way. flameshot.pro contains hard-coded USRPATH that can take one of two values depending on whether CONFIG contains packaging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

description = "Powerful yet simple to use screenshot software";
homepage = https://github.com/lupoDharkael/flameshot;
license = stdenv.lib.licenses.gpl3;
platforms = stdenv.lib.platforms.all;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As indicated in the PR I have only tested this on Ubuntu. From grepping around, i get the impression that .all would be appropriate in this case anyway.

@grahamc
Copy link
Member

grahamc commented Jan 21, 2018

Looks pretty good, can you:

  1. reword the first commit to remove the ( and )s
  2. reword the second commit to say "maintainers: add scode"

@GrahamcOfBorg build flameshot

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: x86_64-linux

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/8ivhdhqdzkz0nc1wgpd98rdipqfcsd7j-flameshot-0.5.0
shrinking /nix/store/8ivhdhqdzkz0nc1wgpd98rdipqfcsd7j-flameshot-0.5.0/bin/flameshot
strip is /nix/store/mdyy001q67hiks0g24ra53z7ckm4jfr4-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/8ivhdhqdzkz0nc1wgpd98rdipqfcsd7j-flameshot-0.5.0/bin 
patching script interpreter paths in /nix/store/8ivhdhqdzkz0nc1wgpd98rdipqfcsd7j-flameshot-0.5.0
checking for references to /tmp/nix-build-flameshot-0.5.0.drv-0 in /nix/store/8ivhdhqdzkz0nc1wgpd98rdipqfcsd7j-flameshot-0.5.0...
postPatchMkspecs
postPatchMkspecs
/nix/store/8ivhdhqdzkz0nc1wgpd98rdipqfcsd7j-flameshot-0.5.0

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success for system: aarch64-linux

post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/qqi1xjcib3lhm1cj3lf4a9321jb7znh8-flameshot-0.5.0
shrinking /nix/store/qqi1xjcib3lhm1cj3lf4a9321jb7znh8-flameshot-0.5.0/bin/flameshot
strip is /nix/store/jwz859pxqj7sl2dbwvmxkx68jp774izb-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/qqi1xjcib3lhm1cj3lf4a9321jb7znh8-flameshot-0.5.0/bin
patching script interpreter paths in /nix/store/qqi1xjcib3lhm1cj3lf4a9321jb7znh8-flameshot-0.5.0
checking for references to /build in /nix/store/qqi1xjcib3lhm1cj3lf4a9321jb7znh8-flameshot-0.5.0...
postPatchMkspecs
postPatchMkspecs
/nix/store/qqi1xjcib3lhm1cj3lf4a9321jb7znh8-flameshot-0.5.0

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

                       ^~~~~~~~~~
src/utils/screengrabber.cpp:51:10: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function
src/utils/screengrabber.cpp:38:8: error: case value is not a constant expression
                case m_info.GNOME: {
                     ^~~~~~~~~~~~
src/utils/screengrabber.cpp:38:8: note: implicit use of 'this' pointer is only allowed within the evaluation of a call to a 'constexpr' member function
2 errors generated.
make: *** [Makefile:2074: screengrabber.o] Error 1
builder for '/nix/store/jlahkn045lp2p0mf2zr0r3hdkrkagnwy-flameshot-0.5.0.drv' failed with exit code 2
error: build of '/nix/store/jlahkn045lp2p0mf2zr0r3hdkrkagnwy-flameshot-0.5.0.drv' failed

@scode scode changed the title (flameshot): init at 0.5.0 flameshot: init at 0.5.0 Jan 21, 2018
@scode
Copy link
Contributor Author

scode commented Jan 21, 2018

@grahamc Done. Apologies. I'm so used to a squash based workflow that I just pushed another commit without thinking. Also fixed the commit msg.

@scode
Copy link
Contributor Author

scode commented Jan 21, 2018

Not sure why it's failing like this on Darwin since I'd expect the compilers to be the same.

@Mic92
Copy link
Member

Mic92 commented Jan 21, 2018

darwin uses clang, while on linux we have gcc.

@scode
Copy link
Contributor Author

scode commented Jan 21, 2018

Reproed locally with clang. I'll submit a PR upstream.

However, curious what the general policy is for things like these. Other than of course preferring to make upstream portable, would the strategy be to let it go in and not work on darwin? Or change the platform to just include linux? Or go ahead and provide patches in nix?

scode added a commit to scode/flameshot that referenced this pull request Jan 21, 2018
As encountered in NixOS/nixpkgs#34096 we fail
to build under clang:

```
src/utils/screengrabber.cpp:56:16: error: case value is not a constant expression
```
@scode
Copy link
Contributor Author

scode commented Jan 21, 2018

flameshot-org/flameshot#101 for the upstream fix

@scode
Copy link
Contributor Author

scode commented Jan 28, 2018

FWIW, upstream is merged (but there's no release containing it yet).

Thoughts on best path forward?

@grahamc grahamc merged commit 140f0a8 into NixOS:master Jan 28, 2018
@scode scode mentioned this pull request Mar 3, 2018
8 tasks
@scode scode deleted the scode/flameshot branch April 16, 2018 04:20
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

5 participants