Comments (35)
https://chocolatey.org/ is generally the best package manager for Windows. I haven't actually uploaded a package there before, but I can take a look over the weekend if no one else has time
from zola.
FYI the Homebrew PR has been merged; so one can now install Gutenberg on macOS using:
brew install gutenberg
from zola.
Mac user here! I don't know anything about making homebrew packages, but here's ripgrep's formula.
I would recommend against .pkg
installs. They're pains in the butt, and it's uncommon to find any programer without homebrew installed.
EDIT: Fixed formula link.
EDIT 2: Homebrew's docs on creating formula.
from zola.
I just submitted a PR to the core repository: Homebrew/homebrew-core#19650
from zola.
Experienced Homebrew-formula writer here—I just started writing a formula after seeing Gutenberg on HN. Is someone already on it? Otherwise if I don’t hit any issue it should be ready tonight.
from zola.
If no one beats me to it, I will create a Nix package for it.
from zola.
@saghm Sorry for the delay, only got around to testing it!
I have tried the following:
pkgname=gutenberg-git
pkgver=0.2.0
pkgrel=1
pkgdesc="An opinionated static site generator written in Rust"
arch=('any')
url="https://github.com/Keats/gutenberg"
license=('MIT')
makedepends=('oniguruma' 'rust' 'git')
source=('git+https://github.com/Keats/gutenberg.git')
sha512sums=('SKIP')
conflicts=('gutenberg')
provides=('gutenberg')
build() {
cd "$srcdir/gutenberg"
cargo build --release
}
package() {
cd "$srcdir/gutenberg"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm755 target/release/gutenberg "$pkgdir/usr/bin/gutenberg"
}
and the Dockerfile:
FROM base/archlinux
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm --needed base-devel git rust
# Setup non-root user to run makepkg
RUN useradd -m -G wheel nonroot
RUN echo "nonroot ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/nonroot && \
chmod 0440 /etc/sudoers.d/nonroot
WORKDIR /home/nonroot
COPY PKGBUILD .
USER nonroot
CMD makepkg -si --noconfirm && gutenberg --version && git clone https://gitlab.com/Keats/vincent.is && cd vincent.is && gutenberg build && ls public/ && cat public/app.css
And that seems to work! The main change is putting oniguruma
as build dep as it will be linked statically by Gutenberg so we don't need it after.
I want to write the PKGBUILD for gutenberg-bin
next as I wouldn't really recommend using gutenberg master branch, it might be buggy sometimes.
from zola.
And
pkgname=gutenberg-bin
pkgver=0.2.0
pkgrel=1
pkgdesc="An opinionated static site generator - Precompiled binary from official repository"
arch=('any')
url="https://github.com/Keats/gutenberg"
license=('MIT')
provides=('gutenberg')
conflicts=('gutenberg')
source=("https://github.com/Keats/gutenberg/releases/download/v${pkgver}/${pkgname/-bin}-v${pkgver}-x86_64-unknown-linux-gnu.tar.gz")
sha256sums=('e41e65cd182dfce0aa77afe77c88f162839b9dfb527274476e2f9de3256bcc40')
package() {
install -Dm755 "${srcdir}/${pkgname/-bin}" "${pkgdir}/usr/bin/${pkgname/-bin}"
}
does the job for a gutenberg-bin
.
@rushmorem any chance you can make a nix derivation for 0.2.0 that was just released?
from zola.
@Keats Will be happy to. Will try to make time for that.
from zola.
I see. Looking at https://github.com/Homebrew/homebrew-core/blob/master/Formula/ripgrep.rb it seems that it's building from source so maybe we can do that as well if people don't mind a long compilation time.
from zola.
Is the AUR package blocked on anything? I'd be happy to submit/maintain an AUR package if someone is needed.
from zola.
@saghm Nothing, I just didn't find the time for it yet
from zola.
I wrote up a PKGBUILD file (minus the checksum, which is liable to change); feel free to use it!
pkgname=gutenberg-git
pkgver=0.1.3
pkgrel=1
_file="${pkgname}-v${pkgver}-x86_64-unknown-linux-gnu.tar.gz"
pkgdesc="An opinionated static site generator written in Rust"
arch=('any')
url="${_file}::https://github.com/Keats/gutenberg"
license=('MIT')
depends=('oniguruma')
makedepends=('rust')
source=($url/archive/v$pkgver.tar.gz)
sha512sums=('..')
build() {
cd "$srcdir/gutenberg-$pkgver"
cargo build --release
}
package() {
cd "$srcdir/gutenberg-$pkgver"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm755 target/release/gutenberg "$pkgdir/usr/bin/gutenberg"
}
from zola.
I'm not sure that would work, the sass
library for example requires at least git
as well and if you want to build from source you'll need rust/cargo too. Is there a way to test the PKGBUILD in a container or something?
Also the source
links to the already built package so you don't need to cargo build
from zola.
I'm not sure that would work, the sass library for example requires at least git as well
I don't think it should be necessary, but if you'd prefer, you can add git
in the makedepends section.
if you want to build from source you'll need rust/cargo too
Yep, that's what the makedepends=('rust')
line is for.
Also the source links to the already built package so you don't need to cargo build.
From downloading and inspecting this, it doesn't seem to be the case. Either way, it's generally preferable to build from source whenever possible (e.g. when installing a proprietary package) since that's what will be expected if the package is ever accepted in the main repos. For things that take an extraordinary long time to build, it's not uncommon to provide a separate <pkgname>-bin
package for users who don't want to build from source. See for example [exa](https://aur.archlinux.org/packages/exa-git/
Is there a way to test the PKGBUILD in a container or something?
Sure! Here's a Dockerfile that installs the package:
FROM base/archlinux
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm --needed base-devel
# Setup non-root user to run makepkg
RUN useradd -m -G wheel nonroot
RUN echo "nonroot ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/nonroot && \
chmod 0440 /etc/sudoers.d/nonroot
WORKDIR /home/nonroot
COPY PKGBUILD .
USER nonroot
CMD makepkg -si --noconfirm && gutenberg --version
from zola.
@Keats Awesome, I'm glad it's working! Looking forward to being able to install it through the AUR
from zola.
I uploaded https://aur.archlinux.org/packages/gutenberg-bin/ but I don't think i'll upload a git version myself though
from zola.
Awesome! I don't plan on using anything but the releases, so the binary version works for me.
from zola.
For macOS, it’d be great to provide an installer .pkg
.
from zola.
@danieleggert is it possible to generate one on Travis? If so, any guide/article on how to do so?
from zola.
I created a few brew Formulars and brew cask Formulars as well. Depends if you want to build it on the machines or just install the packed binaries. I am happy to help out.
from zola.
@Keats Yes, you can do it on Travis. As opposed to @perryprog I’d strongly prefer .pkg
. I think it’s very much as question of preference. Some people have homebrew others don't.
from zola.
Fair enough, why not do both?
from zola.
@Larusso thanks! I think installing the packed binaries is the easiest way as a cargo build --release
is going to take a long time.
Is there some kind of convention in Brew like in AUR? In AUR, you can have several packages like $NAME-bin
means for the precompiled binary, $NAME-git
for building from source from git master and $NAME
would be building building from a tagged commit I guess.
@danieleggert @perryprog Agreed, if we can do both, let's do both!
from zola.
@Keats I don't think so — brew isn't like that too much, https://docs.brew.sh/Formula-Cookbook.html describes how most of the Formulas work and look.
In case you're wondering, installing something using homebrew looks something like this:
brew install ripgrep
brew install vim --without-python2
brew install emacs --with-cocoa
from zola.
@Keats There is a difference between brew and brew cask to start with. Brew Formulars build from Source. But you can provide prebuild binaries so called bottles. Cask on the other hand is for binary packages only. It allows you to execute an install script which can download an app package pkg or whatever. You can even symlink tools for command line use. This is helpfully for apps that also allow command line execution. The Formulars have a different DSL. If you want to build from source you also need to install all the dependencies. I don’t know if this is still the case but MacPorts was way saver when also quite verbose when it comes to compiler dependencies. Brew just falls back to system libraries. The Formular file can get quite complicated when you need to support older versions of Mac OS. With MacPorts you have the complete toolchain under control.
from zola.
Scoop can be interesting to package for; it's a simple Windows package manager targeted at CLI applications.
I can work on adding Gutenberg to it.
Edit: I submitted a pull request to Scoop. Providing 32-bit binaries (possibly using the GNU ABI) may have to be done, I'm not sure.
from zola.
@Keats I’m a bit at loss wrt. Travis. But you’d want to run something like this
#!/bin/sh
#
# Package into a product archive for the macOS installer
#
VERSION=1
IDENTIFIER=is.vincent.gutenberg
TOOL_PATH=${HOME}/Downloads/gb
TEMP=.
OUTPUT_PATH=.
ROOT=${TEMP}/gutenberg.dst
BIN=usr/local/bin
mkdir -p ${ROOT}/${BIN}
for x in gutenberg; do
xcrun ditto ${TOOL_PATH}/${x} ${ROOT}/${BIN}/${x}
done
componentpkg=gutenberg-component.pkg
xcrun pkgbuild \
--root ${ROOT} \
--identifier ${IDENTIFIER}.component \
--version ${VERSION} \
--ownership recommended \
${OUTPUT_PATH}/${componentpkg}
xcrun productbuild \
--product gutenberg-requirements.plist \
--package ${componentpkg} \
--identifier ${IDENTIFIER} \
--version ${VERSION} \
${OUTPUT_PATH}/gutenberg.pkg
And the resulting ${OUTPUT_PATH}/gutenberg.pkg
would then be what you’d distribute.
I’m not sure if you need to clear out $TMP
on Travis or not. And you obviously need to fix the paths in this script to point to where things are on Travis.
This doesn’t sign the package, but it’d be a good start.
from zola.
A follow-up to the Scoop packaging: the pull request has been merged. 😄
from zola.
gutenberg is now available for Windows via scoop. New GitHub releases will be added automagically 😄
$ scoop install gutenberg
from zola.
@Keats How would I go about adding the above script for macOS to the Travis configuration?
from zola.
@Calinou @r15ch13 thanks! I've added it to the docs in 7cf120d
Can you install a specific version or will it always get the latest?
from zola.
@danieleggert I'm not entirely sure to be honest. I am using https://github.com/japaric/trust for the cross-compilation CI and I believe in that case it would need to change https://github.com/Keats/gutenberg/blob/master/ci/before_deploy.sh
However, if .pkg
is something Mac users want, it would make sense to do an issue/PR on trust
so it will happen for way more Rust binaries than just Gutenberg but I don't know whether @japaric is interested in that.
from zola.
Can you install a specific version or will it always get the latest?
Scoop doesn't support this, only the latest version can be installed (the version number cannot be specified upon installing), see Chocolatey Comparison for details.
from zola.
@Calinou @Keats it's possible to install other versions like so:
$ scoop install [email protected]
But it creates a new manifest file and doesn't validate the hash values. It creates a manifest on the fly.
from zola.
Related Issues (20)
- Vertical bar inside of table creates new cell HOT 1
- Would you merge support for plugins? HOT 3
- [Feature Request] About Atomic CSS Engine HOT 1
- Unnecessary rebuilds HOT 3
- Paginated pages should be absent from sitemap.xml HOT 6
- 1.5 Years Since Last Release HOT 1
- [Question] use data/variable in markdown HOT 5
- `get_url` with @ only finds Markdown files HOT 5
- get_section - merge missing translations from other languages HOT 3
- Compilation failure: `ahash`: unknown feature `stdsimd` HOT 4
- Can't build on v0.19.0: Read-only file system HOT 3
- Zola 0.19 no longer builds/serves if I enable feeds. HOT 2
- Zola 0.19 does not detect changes anymore HOT 19
- Zola 0.19 config.generate_feeds not accessible from template files. HOT 2
- Zola 0.19.0 doesn't accept all valid YAML dates HOT 3
- Choose template based on path HOT 2
- Alternative Content Views (Summary, List, ..., like in Hugo) HOT 3
- Failing zola build with option: "external_links_target_blank = true" HOT 3
- "zola serve" doesn't detect any change HOT 7
- zola serve - automatic firefox refresh leads to `Not Found` HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zola.