Skip to content

Commit

Permalink
Merge pull request Unvanquished#11 from FreeSlave/dockerfile
Browse files Browse the repository at this point in the history
qmake project file and Dockerfile. Updated build instructions in README.md
  • Loading branch information
DolceTriade committed Apr 21, 2017
2 parents 43cabde + 07a3a90 commit d750ee1
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
build/
.moc/
*.o
*.exe
*.a
*.lib
updater
moc_*.cpp
moc_*.h
moc_*.o
ui_*.cpp
ui_*.h
qrc_*.cpp
*.stash
*.pro.user
updater_plugin_import.cpp
uic_wrapper.sh
Makefile
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM freeslave/qt5-base-static:5.8.0-1
RUN apt-get install -y autoconf gettext libcppunit-dev libtool libgcrypt11-dev libxml2-dev pkgconf
COPY . /updater
WORKDIR /updater/aria2
RUN autoreconf -i
RUN ARIA2_STATIC=yes ./configure --without-libxml2 --without-libexpat --without-sqlite3 --disable-ssl --enable-libaria2 --without-zlib --without-libcares --enable-static=yes
RUN make clean && make -j`nproc`
WORKDIR /updater
ENV PATH=/opt/Qt5.8-static-release/bin:$PATH
RUN qmake -config release
RUN make clean && make -j`nproc`
CMD cp updater /build-docker
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# updater
Autoupdates Unvanquished using Unvanquished's CDN

## Build Instructions
## Initializing aria2 submodule
```
git submodule init && git submodule update
```

## Build Instructions (CMake)
```
cd aria2
autoreconf -i
Expand All @@ -13,3 +18,17 @@ cd build
cmake ..
make -j4
```

## Build Instructions (qmake)
```
QT_SELECT=5 qmake -config release
make -j4
```

## Build Linux version in docker
```
docker build -t updater .
docker run -v `pwd`/build-docker:/build-docker -u `id -u $USER` updater
strip build-docker/updater # Optionally strip binary to reduce its size
```
Search for updater in build-docker directory.
Empty file added build-docker/.gitkeep
Empty file.
40 changes: 40 additions & 0 deletions updater.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

QT += network widgets gui core
TARGET = updater
TEMPLATE = app

HEADERS += newsfetcher.h \
currentversionfetcher.h \
ariadownloader.h \
downloadworker.h \
system.h \
settingsdialog.h \
downloadtimecalculator.h \
mainwindow.h
SOURCES += newsfetcher.cpp \
currentversionfetcher.cpp \
ariadownloader.cpp \
downloadworker.cpp \
main.cpp \
settingsdialog.cpp \
downloadtimecalculator.cpp \
mainwindow.cpp

mac {
SOURCES += osx.cpp
} unix {
SOURCES += unix.cpp
} win32 {
SOURCES += win.cpp
}

CONFIG += c++11

DEFINES += QUAZIP_BUILD
DEFINES += QUAZIP_STATIC
include(quazip/quazip.pri)

win32:LIBS += -lz aria2/src/.libs/libaria2.a
unix:LIBS += -lz "-Laria2/src/.libs" -laria2
RESOURCES += resources.qrc
FORMS += mainwindow.ui settingsdialog.ui

0 comments on commit d750ee1

Please sign in to comment.