Skip to content

Commit

Permalink
fix up github release
Browse files Browse the repository at this point in the history
  • Loading branch information
jefdaj committed Dec 6, 2019
1 parent 93c95b8 commit fab3f60
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ nixpkgs/inparanoid/*.zip
nixpkgs/inparanoid/*.tar.gz
Paths_*
*.lock
release-*
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ and [A successful Git branching model](https://nvie.com/posts/a-successful-git-b

## [unreleased]

## [0.9.1] - 2019-12-06
### Fixed
- install.sh should work now
- Upload custom release archives because git/github fails on submodules
- Improved UTF-8 locale handling

## [0.9.0] - 2019-12-05
### Changed
- Move development to `develop` branch; `master` will be for releases
- Start using semantic versioning

[unreleased]: https://github.com/jefdaj/shortcut/compare/v0.9.0...HEAD
[unreleased]: https://github.com/jefdaj/shortcut/compare/v0.9.1...HEAD
[0.9.1]: https://github.com/jefdaj/shortcut/releases/tag/v0.9.1
[0.9.0]: https://github.com/jefdaj/shortcut/releases/tag/v0.9.0
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Quick Start
Run [install.sh](install.sh) to install everything on Mac or Linux:

``` .bash
curl https://raw.githubusercontent.com/jefdaj/shortcut/master/install.sh | sh
curl https://raw.githubusercontent.com/jefdaj/shortcut/master/install.sh | bash
source $HOME/.nix-profile/etc/profile.d/nix.sh
```

See [the demo site][1] for a more detailed overview, tutorial, interactive
Expand Down
2 changes: 1 addition & 1 deletion ShortCut.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ShortCut
synopsis: Short, reproducible phylogenomic cuts
author: Jeffrey David Johnson
maintainer: [email protected]
version: 0.9.0
version: 0.9.1
license: AGPL-3
license-file: LICENSE
build-type: Simple
Expand Down
4 changes: 2 additions & 2 deletions ShortCut.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ main = withFileLogging "shortcut.log" $ do
debugS' "shortcut.main" "starting"

-- TODO does this work everywhere?
_ <- setLocale LC_ALL $ Just "en_US.UTF-8"
setEnv "LANG" "en_US.UTF-8" -- TODO and is this part superfluous now?
-- _ <- setLocale LC_ALL $ Just "en_US.UTF-8"
-- setEnv "LANG" "en_US.UTF-8" -- TODO and is this part superfluous now?
-- hSetBuffering stdin LineBuffering
-- hSetBuffering stdout LineBuffering

Expand Down
2 changes: 0 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ let

buildDepends = (drv.buildDepends or []) ++ [ makeWrapper ] ++ runDepends;

# TODO set LC_ALL or similar here?
# TODO PYTHONPATH?
postInstall = ''
${drv.postInstall or ""}
wrapProgram "$out/bin/shortcut" \
--set LC_ALL en_US.UTF-8 \
--set LANG en_US.UTF-8 \
--set LANGUAGE en_US.UTF-8 \
--prefix PATH : "${pkgs.lib.makeBinPath runDepends}"'' +
Expand Down
26 changes: 26 additions & 0 deletions dev-scripts/build-release-archives.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Github releases fail to include submodules, so we have to fix them manually.
# Push the release tag, run this, then go to the "edit tag" page on Github and attach the files.
# Usage: ./dev-scripts/build-release-archives.sh <git tag>

set -E

tag="$1"

rm -rf release-${tag}
mkdir release-${tag}
pushd release-${tag}

git clone http://github.com/jefdaj/shortcut
pushd shortcut
git checkout ${tag}
git submodule update --init --recursive
rm -rf .git*
popd

tar cvzf shortcut-${tag}.tar.gz shortcut
zip -r shortcut-${tag}.zip shortcut

echo "release files:"
du -h shortcut-*
13 changes: 8 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#/usr/bin/env bash

case "$(uname)" in
Linux ); export NIX_PATH=nixpkgs=channel:nixpkgs-19.03;;
Darwin); export NIX_PATH=nixpkgs=channel:nixpkgs-19.03-darwin;;
*); (echo "Sorry, unsupported OS: $(uname). Manual install?"; exit 1)
Linux ) export CHANNEL=nixos-19.09 ;;
Darwin) export CHANNEL=nixpkgs-19.09-darwin ;;
*) (echo "Sorry, unsupported OS: $(uname). Manual install?"; exit 1) ;;
esac

echo "Installing the Nix package manager..."
Expand All @@ -12,12 +12,15 @@ if [[ $? != 0 ]]; then
curl https://nixos.org/nix/install | sh
source $HOME/.nix-profile/etc/profile.d/nix.sh
fi
# the options thing works around: https://github.com/NixOS/nix/issues/2733
nix-channel --add https://nixos.org/channels/${CHANNEL}
nix-channel --options substituters "" --update

# TODO name the cache shortcut?
echo "Setting Nix to use the ShortCut package cache..."
nix-env -iA cachix -f https://cachix.org/api/v1/install
[[ "$(uname)" == Darwin ]] && sudo cachix use jefdaj || cachix use jefdaj

echo "Installing ShortCut from GitHub..."
branch='master'
nix-env -i -f https://github.com/jefdaj/shortcut/archive/${branch}.tar.gz
archive='https://github.com/jefdaj/shortcut/files/3934119/shortcut-v0.9.1.tar.gz'
nix-env -i -f $archive
3 changes: 1 addition & 2 deletions modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ with import ./nixpkgs;
let
mkModule = src: extraRunDeps: extraWraps:
let name = "Shortcut-" + baseNameOf src;
runDeps = [ coreutils ] ++ extraRunDeps;
runDeps = [ bash coreutils ] ++ extraRunDeps;
in stdenv.mkDerivation {
inherit src name extraRunDeps extraWraps;
buildInputs = [ makeWrapper ] ++ extraRunDeps;
builder = writeScript "builder.sh" ''
#!/usr/bin/env bash
source ${stdenv}/setup
mkdir -p $out/bin
for script in $src/*; do
Expand Down
2 changes: 1 addition & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ let
shortcut = import ./default.nix;
devDepends = [
stack
zip
# pypi2nix
];

Expand All @@ -15,7 +16,6 @@ in haskell.lib.overrideCabal shortcut (drv: {
# TODO is the find command going? that could maybe make the difference
shellHook = ''
${drv.shellHook or ""}
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# export TASTY_HIDE_SUCCESSES=True
Expand Down
14 changes: 1 addition & 13 deletions shortcut.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,11 @@
}:
mkDerivation {
pname = "ShortCut";
version = "0.8.4.11";
version = "0.9.1";
src = ./.;
isLibrary = true;
isExecutable = true;
enableSeparateDataOutput = true;
libraryHaskellDepends = [
ansi-terminal base bytestring concurrent-extra configurator
containers cryptohash data-default-class directory dlist docopt
download filelock filepath Glob haskeline hspec logging MissingH
mtl parsec path path-io posix-escape pretty process progress-meter
QuickCheck random random-shuffle raw-strings-qq regex-compat
regex-posix retry safe-exceptions scientific setlocale shake
silently split strict tasty tasty-golden tasty-hspec tasty-hunit
tasty-quickcheck temporary terminal-size text time transformers
unbounded-delays unix utility-ht
];
libraryPkgconfigDepends = [ zlib ];
executableHaskellDepends = [
ansi-terminal base bytestring concurrent-extra configurator
containers cryptohash data-default-class directory dlist docopt
Expand Down
2 changes: 1 addition & 1 deletion singularity.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

# TODO why is setting it here different from inside singularity?
export LC_ALL="en_US.UTF-8"
export LC_ALL="en_US.utf8"

condo=/clusterfs/rosalind/users
scratch=/global/scratch
Expand Down

0 comments on commit fab3f60

Please sign in to comment.