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

ebook2cw: init at 0.8.2 #31416

Merged
merged 1 commit into from Nov 10, 2017
Merged

ebook2cw: init at 0.8.2 #31416

merged 1 commit into from Nov 10, 2017

Conversation

earldouglas
Copy link
Member

Motivation for this change

Allow Nix users to easily install and run ebook2cw

Things done
  • 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/)
  • Fits CONTRIBUTING.md.

@earldouglas earldouglas changed the title ebook2cw: init at 8.0.2 ebook2cw: init at 0.8.2 Nov 9, 2017
description = "Convert ebooks to Morse MP3s/OGGs";
homepage = http://fkurz.net/ham/ebook2cw.html;
license = licenses.gpl2;
platforms = platforms.linux;
Copy link
Member Author

Choose a reason for hiding this comment

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

This should build on other platforms as well, but I have no way to test it.

Copy link
Member

@lukateras lukateras Nov 9, 2017

Choose a reason for hiding this comment

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

Since upstream explicitly supports other platforms, I'd bump it to platforms.all.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Copy link
Member

@lukateras lukateras left a comment

Choose a reason for hiding this comment

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

Builds and seems to work! However, patchPhase is not extendable and can be improved.


buildInputs = [ lame libvorbis ];

patchPhase = "patch -p0 < ${./configfile.patch}";
Copy link
Member

@lukateras lukateras Nov 9, 2017

Choose a reason for hiding this comment

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

Append a/ and b/ to the first two lines of the patch:

--- a/ebook2cw.c	2017-11-08 19:52:58.298131348 -0700
+++ b/ebook2cw.c	2017-11-08 19:53:02.588231067 -0700
@@ -136,7 +136,7 @@
 	char isomap[256][4]; 		/* by these strings */
 	char utf8map[256][8];

-	char configfile[1025];
+	char configfile[2048];

 	char id3_author[80],
 		id3_title[80],

Then you can just use patches list, that would make it easier for other people to apply their own patches:

patches = [ ./configfile.patch ];

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

};

# TODO: Use SVN once fetchsvn stops stripping the trailing slash,
# otherwise we get a build failure due to a redirect cycle.
Copy link
Member

@lukateras lukateras Nov 9, 2017

Choose a reason for hiding this comment

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

Is there a GitHub issue with this bug? I can't find one.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will add one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #31441

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like it works if we change http:// to svn://. Updated to use fetchsvn.

char utf8map[256][8];

- char configfile[1025];
+ char configfile[2048];
Copy link
Member

Choose a reason for hiding this comment

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

I've asked upstream to cut a new version with this patch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Upstream says it's fixed in trunk, but that a new version won't be cut for several weeks.

Would it be better to switch from the release version (0.8.2) to a SVN revision number and drop the patch, or leave as-is and wait for a new release?

Copy link
Member Author

Choose a reason for hiding this comment

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

Never mind -- we can't switch to an SVN revision number until #31441 is fixed.

@lukateras
Copy link
Member

lukateras commented Nov 9, 2017

Unfortunately, macOS build fails due to missing gcc: https://travis-ci.org/NixOS/nixpkgs/jobs/299664746

I'm pretty sure this can be resolved by adding this to the derivation:

  postPatch = ''
    substituteInPlace Makefile --replace gcc cc
  '';

At least it builds with clangStdenv.

@lukateras
Copy link
Member

Thanks, now it builds on Darwin. This should be ready to merge.

@earldouglas
Copy link
Member Author

Cool; thanks for your help!

@orivej orivej merged commit 0a51e1b into NixOS:master Nov 10, 2017
@earldouglas earldouglas deleted the ebook2cw branch November 10, 2017 20:51
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