Skip to content

Update build & install instructions for MSys2/Windows #149

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
*.o
git-crypt
git-crypt*
31 changes: 24 additions & 7 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,27 @@ Using the brew package manager, simply run:

EXPERIMENTAL WINDOWS SUPPORT

git-crypt should build on Windows with MinGW, although the build system
is not yet finalized so you will need to pass your own CXX, CXXFLAGS, and
LDFLAGS variables to make. Additionally, Windows support is less tested
and does not currently create key files with restrictive permissions,
making it unsuitable for use on a multi-user system. Windows support
will mature in a future version of git-crypt. Bug reports and patches
are most welcome!
git-crypt should build on Windows with MinGW. Additionally, Windows
support is less tested and does not currently create key files with
restrictive permissions, making it unsuitable for use on a multi-user
system. Windows support will mature in a future version of git-crypt.
Bug reports and patches are most welcome!

1. Install a MinGW/MSys2 development environment, for example using
https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2:
1. Remove or rename `%USERPROFILE%\.bashrc` if you have one prior
to installation.
2. Install [MSys2](https://www.msys2.org/) & make sure there is
no more update pending using `pacman -Syuu`.
3. From a MSYS2 MinGW 64-bit terminal, install the development
environment:

$ pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain \
git subversion mercurial \
mingw-w64-i686-cmake mingw-w64-x86_64-cmake

2. In a MSYS2 MinGW 64-bit terminal, run `make`
3. Manually install the generated `git-crypt.exe` somewhere in your
`%PATH%` or simply run `make install` if you plan to use it only
from MSys2

30 changes: 23 additions & 7 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,26 @@ Using the brew package manager, simply run:

### Experimental Windows Support

git-crypt should build on Windows with MinGW, although the build system
is not yet finalized so you will need to pass your own CXX, CXXFLAGS, and
LDFLAGS variables to make. Additionally, Windows support is less tested
and does not currently create key files with restrictive permissions,
making it unsuitable for use on a multi-user system. Windows support
will mature in a future version of git-crypt. Bug reports and patches
are most welcome!
git-crypt should build on Windows with MinGW. Additionally, Windows
support is less tested and does not currently create key files with
restrictive permissions, making it unsuitable for use on a multi-user
system. Windows support will mature in a future version of git-crypt.
Bug reports and patches are most welcome!

1. Install a MinGW/MSys2 development environment, for example using
https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2:
1. Remove or rename `%USERPROFILE%\.bashrc` if you have one prior
to installation.
2. Install [MSys2](https://www.msys2.org/) & make sure there is
no more update pending using `pacman -Syuu`.
3. From a MSYS2 MinGW 64-bit terminal, install the development
environment:

$ pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain \
git subversion mercurial \
mingw-w64-i686-cmake mingw-w64-x86_64-cmake

2. In a MSYS2 MinGW 64-bit terminal, run `make`
3. Manually install the generated `git-crypt.exe` somewhere in your
`%PATH%` or simply run `make install` if you plan to use it only
from MSys2
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man

ifeq ($(OS),Windows_NT)
# MSys2 install instead of ./INSTALL
INSTALL = /usr/bin/install
else
INSTALL = install
endif

ENABLE_MAN ?= no
DOCBOOK_XSL ?= http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl

$(info OSTYPE=$(OSTYPE))

OBJFILES = \
git-crypt.o \
commands.o \
Expand Down Expand Up @@ -82,12 +91,12 @@ INSTALL_TARGETS := install-bin $(INSTALL_MAN_TARGETS-$(ENABLE_MAN))
install: $(INSTALL_TARGETS)

install-bin: build-bin
install -d $(DESTDIR)$(BINDIR)
install -m 755 git-crypt $(DESTDIR)$(BINDIR)/
$(INSTALL) -d $(DESTDIR)$(BINDIR)
$(INSTALL) -m 755 git-crypt $(DESTDIR)$(BINDIR)/

install-man: build-man
install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 man/man1/git-crypt.1 $(DESTDIR)$(MANDIR)/man1/
$(INSTALL) -d $(DESTDIR)$(MANDIR)/man1
$(INSTALL) -m 644 man/man1/git-crypt.1 $(DESTDIR)$(MANDIR)/man1/

.PHONY: all \
build build-bin build-man \
Expand Down