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

Write: init at 2.0.9 from Styluslabs #42574

Closed
wants to merge 15 commits into from
Closed

Write: init at 2.0.9 from Styluslabs #42574

wants to merge 15 commits into from

Conversation

oyren
Copy link
Contributor

@oyren oyren commented Jun 25, 2018

Motivation for this change

I want to add Write from styluslabs.com as a package. This is my first commit, so please tell me if i am doing something wrong ;).

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.

@oyren oyren changed the title Write from Styluslabs (new package) Write: init at 2.0.9 from Styluslabs Jun 26, 2018
homepage = http://www.styluslabs.com/;
description = "Write is a word processor for handwriting.";
platforms = platforms.linux;
maintainers = [ "m.scheuren@oyra.eu" ];
Copy link
Member

Choose a reason for hiding this comment

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

I think the current policy is that you should add a full entry for yourself in https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix and use the attr here.

$out/Write/Write
'';

meta = with stdenv.lib; {
Copy link
Member

Choose a reason for hiding this comment

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

Please mention the license, since Write is unfree.

Copy link
Contributor Author

@oyren oyren Jun 27, 2018

Choose a reason for hiding this comment

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

I'm not sure here, would it be right to add "license = stdenv.lib.licenses.unfreeRedistributable;"?
@symphorien

Copy link
Member

Choose a reason for hiding this comment

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

The license does not look like redistributable:

The LICENSEE may not reproduce or distribute the SOFTWARE PRODUCT.

so just unfree, I guess.

Copy link
Contributor Author

@oyren oyren Jun 28, 2018

Choose a reason for hiding this comment

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

" stdenv.lib.licenses.unfree, "unfree"
Unfree package that cannot be redistributed. You can build it yourself, but you cannot redistribute the output of the derivation. Thus it cannot be included in the Nixpkgs channel. "

So I can close the pull request?

Copy link
Member

Choose a reason for hiding this comment

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

You should read "it won't be build by hydra, but compiled locally". There are dozens of unfree derivations in nixpkgs: https://search.nix.gsc.io/?q=unfree&i=nope&files=pkgs&repos=
The formulation is arguably misleading, maybe the docs need to be made clearer.

};

src = fetchurl {
url = "http://www.styluslabs.com/download/write-tgz";
Copy link
Member

Choose a reason for hiding this comment

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

Correct me if I am wrong, but the file pointed to by this url will probably change on the next update of Write, and will break the hash. If so, please replace it with an immutable url.

@@ -0,0 +1,53 @@
{ stdenv, lib, qt5, makeWrapper, fetchurl, makeDesktopItem }:
stdenv.mkDerivation rec {
name = "write_stylus";
Copy link
Member

Choose a reason for hiding this comment

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

The name should follow the pattern "name-version".

homepage = http://www.styluslabs.com/;
description = "Write is a word processor for handwriting.";
platforms = platforms.linux;
maintainers = [ oyren ];
Copy link
Member

Choose a reason for hiding this comment

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

stdenv.lib.maintainers.oyren, see the OfBorg error:

while evaluating the attribute 'maintainers' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-0-gleber.ewr1.nix.ci/pkgs/applications/graphics/write_stylus/default.nix:52:5:
undefined variable 'oyren' at /var/lib/ofborg/checkout/repo/38dca4e3aa6bca43ea96d2fcc04e8229/mr-est/eval-0-gleber.ewr1.nix.ci/pkgs/applications/graphics/write_stylus/default.nix:52:21

sourceRoot = ".";
unpackCmd = ''
tar xfz "$src"
'';
Copy link
Member

Choose a reason for hiding this comment

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

sourceRoot and unpackCmd are probably unnecessary now that the url ends with .tar.gz

Copy link
Contributor Author

Choose a reason for hiding this comment

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

couldn't build it without sourceRoot. So i just removed unpackCmd.

@@ -0,0 +1,54 @@
{ stdenv, lib, qt5, makeWrapper, fetchurl, makeDesktopItem }:
Copy link
Member

Choose a reason for hiding this comment

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

you should not add qt5 as an argument: see https://nixos.org/nixpkgs/manual/#ssec-qt-applications

Copy link
Contributor Author

@oyren oyren Jun 28, 2018

Choose a reason for hiding this comment

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

I just followed this guide https://nixos.wiki/wiki/Packaging/Binaries

If i remove qt5, the package don't build, tried to fix it with "qt5.callPackage" but than i get undefined variable qt5 or undefined variable qtbase.

edited: copy paste error

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 specificity of qt: if you use libsForQt5.callPackage instead of callPackage, you can add qtbase and other attributes of qt5 directly as an argument. See as an example https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/digitalbitbox/default.nix#L13-L16 and https://github.com/NixOS/nixpkgs/blob/release-18.03/pkgs/top-level/all-packages.nix#L124

@ryantm
Copy link
Member

ryantm commented Jul 3, 2018

Thanks for the contribution; please squash this into one commit and use a commit message that is consistent with https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md for example write_stylus: init at 209

};
sourceRoot = ".";

buildPhase = ":"; # nothing to build
Copy link
Member

Choose a reason for hiding this comment

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

You can probably use dontBuild = true; here.

@oyren
Copy link
Contributor Author

oyren commented Jul 3, 2018

@ryantm I'm sorry, but I'm not that familiar with git. How can I squash this into one commit? I tried it with git rebase, without success.

@ryantm
Copy link
Member

ryantm commented Jul 3, 2018

@oyren No problem, I'll try to help!

Your main problem is you merged master into your development branch.

Here's a rough script for how to fix it:

# Start back before you merged master
git checkout -b fixup-write 8fa0c34
# now make your change for dontBuild again and commit it...

#rebase onto origin/master
git rebase -i origin/master
# use "reword" for " Write from Styluslabs (new package)"
# use "squash" for every other commit
# exit rebasing
# use "write_stylus: init at 209" for the reworded commit message
# push with -force to oyren:master (since that is where you based this PR on)

Please let me know if you get stuck!

@oyren
Copy link
Contributor Author

oyren commented Jul 4, 2018

@ryantm
'Your main problem is you merged master into your development branch.'
This will never happen again, next time I will create a branch and thanks for your help.

But I got stucked :(.
As you said I did a git checkout whiteout problems.
If I do git rebase -i origin/master, vim open's the file 'git-rebase-todo' whit noop in it.
So I wrote the following into the file:

reword a6a21c4
squash aa3ed30
squash 3d9305d
squash 2f8d63e
squash fa660f5
squash 0f0bc74
squash e97ca5a
squash af8bebe
squash ccfaf49
squash 9936a44
squash 4348cb0
squash ba5500d
squash 8fa0c34
squash deff906
squash 4d18183

Saved and closed the file and get the following error's:
error: commit aa3ed30 is a merge but no -m option was given.
error: could not rename '.git/rebase-merge/message-squash' to '.git/rebase-merge/message'

Maybe I should Close this PR and do a new one?

@ryantm
Copy link
Member

ryantm commented Jul 4, 2018

@oyren Sure, there's no reason you can't just copy the files onto a fresh checkout of NixOS/master and make a new PR.

@oyren
Copy link
Contributor Author

oyren commented Jul 4, 2018

There is the new PR #43044

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