@ -0,0 +1,2 @@
|
||||
If a package fails to build, upload the log file to
|
||||
https://gist.github.com/ and put the link here.
|
@ -0,0 +1,19 @@
|
||||
Please read http://mxe.cc/#creating-packages
|
||||
|
||||
In particular, make sure that your build rules:
|
||||
|
||||
* install .pc file,
|
||||
* install bin/test-pkg.exe compiled with flags by pkg-config,
|
||||
* install .dll to bin/ and .a, .dll.a to lib/,
|
||||
* use $(TARGET)-cmake instead of cmake,
|
||||
* build in `$(BUILD_DIR)` instead of `$(SOURCE_DIR)`,
|
||||
* do not run target executables with Wine,
|
||||
* do not download anything while building,
|
||||
* do not install documentation,
|
||||
* do not install .exe files except test and build systems,
|
||||
|
||||
and .patch files are generated by tools/patch-tool-mxe.
|
||||
|
||||
If you add a package, you can use tool tools/skeleton.py.
|
||||
|
||||
Thanks!
|
@ -1,18 +1,15 @@
|
||||
dist: trusty
|
||||
language: c
|
||||
sudo: false
|
||||
|
||||
script:
|
||||
- make versions.json
|
||||
- git config --global user.email 'mxebot@gmail.com'
|
||||
- git config --global user.name 'MXEBot as Travis CI'
|
||||
- git config --global push.default simple
|
||||
- git config credential.helper "store --file=.git/credentials"
|
||||
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials
|
||||
- git remote set-url origin 'https://github.com/mxe/mxe.git'
|
||||
- git commit -a -m 'Update versions.json' || true
|
||||
- git push origin HEAD:master
|
||||
- git push origin HEAD:gh-pages
|
||||
- make docs/build-matrix.html docs/packages.json OS_SHORT_NAME=disable-native-plugins
|
||||
- if [ "$GH_TOKEN" != "" ]; then ./tools/travis-push.sh; fi
|
||||
# Package wxwidgets is downloaded for more than 10 minutes,
|
||||
# Travis failed because of no output for 10 minutes.
|
||||
- while true; do sleep 60; echo -n ' '; done &
|
||||
- make download -j 6 -k MXE_PLUGIN_DIRS="$(./tools/plugins-with-additional-packages.sh)"
|
||||
|
||||
env:
|
||||
global:
|
||||
secure: M3fS92HUV+3PklS3h1CVG+TuhZLYgGEeWVsL0ICvJKnbMSvaqm0/OAxwlXbKLkZ/j6JK2yGgChx8QzffkoRr67tHCaPM7cR7mFRn7GivJcgZcA8UAaL9V4AtEHqFIonat8XEsxruUPJyVHgGiTBQfKphQEGtKtHF8iSUhvIxqC8=
|
||||
secure: "i8BKOLA0U/zZchCQmnTmK9yCawoWlRJKXlpSvdmSo5w+OyFbWO372CmMFxyAzSa9umC3QLhCDzd9CcpqtDsSZTKPWqCTPZ+HYKMBmFi8jIxqWOuNVn3KTGWOhpWM6az/w7lDqrJ/W30H2wnJBRJFocOiRdkrSOpuLDv0s0loFsU="
|
||||
|
@ -1,33 +1,49 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
MXE is licensed under the MIT Licence. The makefiles and utilities under
|
||||
`plugins/`, `src/`, and `tools/` all share this licence.
|
||||
|
||||
Copyright (c) 2007-2015
|
||||
> Copyright (c) 2007-2016
|
||||
>
|
||||
> * Volker Diels-Grabsch
|
||||
> * Mark Brand
|
||||
> * Tony Theodore
|
||||
> * Martin Gerhardy
|
||||
> * Tiancheng "Timothy" Gu
|
||||
> * Boris Nagaev
|
||||
> * ... and many other [contributors][contributors]
|
||||
>
|
||||
> (contact via the [project mailing list][mailing-list] or
|
||||
> [issue tracker][issue-tracker])
|
||||
>
|
||||
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
> of this software and associated documentation files (the "Software"), to deal
|
||||
> in the Software without restriction, including without limitation the rights
|
||||
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
> copies of the Software, and to permit persons to whom the Software is
|
||||
> furnished to do so, subject to the following conditions:
|
||||
>
|
||||
> The above copyright notice and this permission notice shall be included in all
|
||||
> copies or substantial portions of the Software.
|
||||
>
|
||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
> SOFTWARE.
|
||||
|
||||
* Volker Diels-Grabsch
|
||||
* Mark Brand
|
||||
* Tony Theodore
|
||||
* Martin Gerhardy
|
||||
* Tiancheng "Timothy" Gu
|
||||
* Boris Nagaev
|
||||
* ... and many other contributors
|
||||
MXE distributes code from the following projects in the `ext/` directory:
|
||||
|
||||
(contact via the project mailing list)
|
||||
- [GNU config.guess][config.guess] [GPL3+ with Autoconf exception]
|
||||
- [GNU Make Standard Library][gmsl] [BSD 3-clause]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The [packages][packages] downloaded by MXE (ending up in `pkg/`) each
|
||||
have their own licence(s). Please see the individual source trees and/or
|
||||
websites for further details.
|
||||
|
||||
[contributors]: https://github.com/mxe/mxe/graphs/contributors
|
||||
[mailing-list]: https://lists.nongnu.org/mailman/listinfo/mingw-cross-env-list
|
||||
[issue-tracker]: https://github.com/mxe/mxe/issues
|
||||
[config.guess]: https://github.com/mxe/mxe/blob/master/ext/config.guess#L3-L27
|
||||
[gmsl]: https://github.com/mxe/mxe/blob/master/ext/gmsl#L8-L40
|
||||
[packages]: http://mxe.cc/#packages
|
||||
|
@ -1,23 +0,0 @@
|
||||
- Ensure that your Git repository is configured correctly:
|
||||
http://mxe.cc/#committers
|
||||
- Ensure all stable commits have been merged to master
|
||||
- run `make cleanup-style`
|
||||
- check html with http://validator.w3.org/
|
||||
- get list of new packages:
|
||||
git diff --name-status stable..master | grep 'A.*.mk$' | gsed -n 's,A.*src/\(.*\)\.mk,\1\,,p' | tr '\n' ' '
|
||||
- call for testers:
|
||||
github issue
|
||||
MXE mailing list
|
||||
use the following to check for new/changed requirements:
|
||||
http://htmlpreview.github.io/?https://raw.github.com/mxe/mxe/master/index.html
|
||||
...
|
||||
|
||||
- Fast-forward the stable branch to master:
|
||||
git checkout stable
|
||||
git merge --ff-only master
|
||||
git push
|
||||
- Announce in mailing lists, forums, etc.
|
||||
MXE mailing list
|
||||
Freecode.com (formerly Freshmeat.net)
|
||||
MinGW mailing list
|
||||
Hacker News (news.ycombinator.com)
|
@ -1,5 +1,4 @@
|
||||
/* This file is part of MXE.
|
||||
* See index.html for further information. */
|
||||
/* This file is part of MXE. See LICENSE.md for licensing information. */
|
||||
|
||||
table.fullscreen {
|
||||
width: 100%;
|
@ -1,5 +1,4 @@
|
||||
/* This file is part of MXE.
|
||||
* See index.html for further information. */
|
||||
/* This file is part of MXE. See LICENSE.md for licensing information. */
|
||||
body {
|
||||
font-size: 11pt;
|
||||
margin-top: 0em;
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 240 KiB After Width: | Height: | Size: 240 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 114 KiB |
@ -0,0 +1,141 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# Standardise GitHub downloads and updates
|
||||
# Download API has two forms:
|
||||
# Archive:
|
||||
# url = <owner>/<repo>/archive/<ref>.tar.gz
|
||||
# dir = <repo>-<ref>
|
||||
# if <ref> starts with a single `v`, it is removed from dir
|
||||
#
|
||||
# Tarball:
|
||||
# url = <owner>/<repo>/tarball/<ref>/output-file.tar.gz
|
||||
# dir = <owner>-<repo>-<short sha>
|
||||
#
|
||||
# TODO: also third api - `releases` see libass.mk
|
||||
# grep -l 'MXE_GET_GITHUB\|api.github.com\|github.com.*archive' src/*.mk | xargs grep -L 'GH_CONF'
|
||||
#
|
||||
# Filename doesn't matter as we stream the url to a name of our choosing.
|
||||
#
|
||||
# The archive API could be used for all packages, however, if the reference
|
||||
# is any sort of SHA, the full SHA is used for the directory. We could `cd`
|
||||
# into it without knowing the SHA beforehand, but the directory length would
|
||||
# be comical in logs etc.
|
||||
#
|
||||
# The tarball API accepts references to commits or tags, always using the
|
||||
# short SHA as the directory. In this case, tag tracking packages would have
|
||||
# to store the SHA (see #1002). However, this only works for lightweight
|
||||
# tags, not annotated tags that most projects use for releases.
|
||||
#
|
||||
# In summary, we have to use both.
|
||||
|
||||
# The tarball API determines the short SHA length used in the directory name.
|
||||
# Chances of a collision on a "given" commit seem to decrease as the chance
|
||||
# of "any" collision increases. If that changes in the future, `make update`
|
||||
# will fix it.
|
||||
# Currently (2015-12) the API sets the short SHA length to:
|
||||
GITHUB_SHA_LENGTH := 7
|
||||
|
||||
# Packages must set the following metadata:
|
||||
# Track branch - Tarball API
|
||||
# GH_CONF := owner/repo/branch
|
||||
# updates will use the last commit from the specified branch as
|
||||
# a version string and bypass `sort -V`
|
||||
#
|
||||
# Track tags - Archive API
|
||||
# GH_CONF := owner/repo, tag prefix, tag suffix, tag filter-out, version separator
|
||||
# updates will construct a version number based on:
|
||||
# <tag prefix><s/<version sep>/./version><tag suffix>
|
||||
|
||||
# common tag filtering is applied with `grep -v`:
|
||||
GITHUB_TAG_FILTER := alpha\|beta\|rc
|
||||
|
||||
# More complex filters can fall back to `MXE_GET_GH_TAGS` which returns
|
||||
# a list for post-processing.
|
||||
|
||||
# ...and finally, auto-configure packages based on above metadata:
|
||||
# - `eval` these snippets during PKG_RULE loop (where PKG is in scope).
|
||||
# - `call` or `eval` from package makefiles requires complex quoting
|
||||
# and looks out of place.
|
||||
# - don't redefine manually set standard variables (FILE, SUBDIR, URL, UPDATE)
|
||||
|
||||
GH_OWNER = $(word 1,$(subst /,$(space),$(word 1,$(subst $(comma),$(space),$($(PKG)_GH_CONF)))))
|
||||
GH_REPO = $(word 2,$(subst /,$(space),$(word 1,$(subst $(comma),$(space),$($(PKG)_GH_CONF)))))
|
||||
GH_BRANCH = $(word 3,$(subst /,$(space),$(word 1,$(subst $(comma),$(space),$($(PKG)_GH_CONF)))))
|
||||
GH_TAG_VARS = $(call rest,$(subst $(comma),$(space)$(__gmsl_aa_magic),$(subst $(space),,$($(PKG)_GH_CONF))))
|
||||
GH_TAG_PREFIX = $(subst $(__gmsl_aa_magic),,$(word 1,$(GH_TAG_VARS)))
|
||||
GH_TAG_SUFFIX = $(subst $(__gmsl_aa_magic),,$(word 2,$(GH_TAG_VARS)))
|
||||
GH_TAG_FILTER = $(subst $(__gmsl_aa_magic),,$(word 3,$(GH_TAG_VARS)))
|
||||
GH_VERSION_SEP = $(subst $(__gmsl_aa_magic),,$(word 4,$(GH_TAG_VARS)))
|
||||
|
||||
define MXE_SETUP_GITHUB
|
||||
$(PKG)_GH_OWNER := $(GH_OWNER)
|
||||
$(PKG)_GH_REPO := $(GH_REPO)
|
||||
$(PKG)_BRANCH := $(GH_BRANCH)
|
||||
$(PKG)_TAG_VARS := $(GH_TAG_VARS)
|
||||
$(PKG)_TAG_PREFIX := $(GH_TAG_PREFIX)
|
||||
$(PKG)_TAG_SUFFIX := $(GH_TAG_SUFFIX)
|
||||
$(PKG)_TAG_FILTER := $(GH_TAG_FILTER)
|
||||
$(PKG)_VERSION_SEP := $(or $(GH_VERSION_SEP),.)
|
||||
$(PKG)_FILE := $(or $($(PKG)_FILE),$(PKG)-$$($$(PKG)_TAG_PREFIX)$($(PKG)_VERSION)$$($$(PKG)_TAG_SUFFIX).tar.gz)
|
||||
$(if $(and $(GH_BRANCH),$(GH_TAG_VARS)),\
|
||||
$(error $(newline) $(PKG) specifies both branch and tag variables $(newline)))
|
||||
$(if $(GH_BRANCH),$(value MXE_SETUP_GITHUB_BRANCH),$(value MXE_SETUP_GITHUB_TAG))
|
||||
endef
|
||||
|
||||
define MXE_SETUP_GITHUB_BRANCH
|
||||
$(PKG)_SUBDIR := $(or $($(PKG)_SUBDIR),$($(PKG)_GH_OWNER)-$($(PKG)_GH_REPO)-$($(PKG)_VERSION))
|
||||
$(PKG)_URL := $(or $($(PKG)_URL),https://github.com/$($(PKG)_GH_OWNER)/$($(PKG)_GH_REPO)/tarball/$($(PKG)_VERSION)/$($(PKG)_FILE))
|
||||
$(PKG)_UPDATE := $(or $($(PKG)_UPDATE),$(call MXE_GET_GH_SHA,$($(PKG)_GH_OWNER)/$($(PKG)_GH_REPO),$($(PKG)_BRANCH)))
|
||||
endef
|
||||
|
||||
define MXE_SETUP_GITHUB_TAG
|
||||
$(PKG)_SUBDIR := $(or $($(PKG)_SUBDIR),$($(PKG)_GH_REPO)-$(if $(call sne,v,$($(PKG)_TAG_PREFIX)),$($(PKG)_TAG_PREFIX))$(subst .,$($(PKG)_VERSION_SEP),$($(PKG)_VERSION))$($(PKG)_TAG_SUFFIX))
|
||||
$(PKG)_TAR_GZ := $(or $($(PKG)_TAR_GZ),$($(PKG)_GH_REPO)-$($(PKG)_TAG_PREFIX)$(subst .,$($(PKG)_VERSION_SEP),$($(PKG)_VERSION))$($(PKG)_TAG_SUFFIX))
|
||||
$(PKG)_URL := $(or $($(PKG)_URL),https://github.com/$($(PKG)_GH_OWNER)/$($(PKG)_GH_REPO)/archive/$(subst $($(PKG)_GH_REPO)-,,$($(PKG)_TAR_GZ)).tar.gz)
|
||||
$(PKG)_UPDATE := $(or $($(PKG)_UPDATE),$(call MXE_GET_GH_TAG,$($(PKG)_GH_OWNER)/$($(PKG)_GH_REPO),$($(PKG)_TAG_PREFIX),$($(PKG)_TAG_SUFFIX),$(or $($(PKG)_TAG_FILTER),$(GITHUB_TAG_FILTER)),$($(PKG)_VERSION_SEP)))
|
||||
endef
|
||||
|
||||
# called with owner/repo,branch
|
||||
define MXE_GET_GH_SHA
|
||||
$(WGET) -q -O- 'https://api.github.com/repos/$(strip $(1))/git/refs/heads/$(strip $(2))' \
|
||||
| $(SED) -n 's#.*"sha": "\([^"]\{$(GITHUB_SHA_LENGTH)\}\).*#\1#p' \
|
||||
| head -1
|
||||
endef
|
||||
|
||||
# called with owner/repo
|
||||
define MXE_GET_GH_TAGS
|
||||
$(WGET) -q -O- 'https://api.github.com/repos/$(strip $(1))/git/refs/tags/' \
|
||||
| $(SED) -n 's#.*"ref": "refs/tags/\([^"]*\).*#\1#p'
|
||||
endef
|
||||
|
||||
# called with owner/repo, tag prefix, tag suffix, filter-out, version sep
|
||||
define MXE_GET_GH_TAG
|
||||
$(MXE_GET_GH_TAGS) \
|
||||
| $(if $(4),grep -v '$(strip $(4))') \
|
||||
| $(SED) -n 's,^$(strip $(2))\([^"]*\)$(strip $(3))$$,\1,p' \
|
||||
| tr '$(strip $(5))' '.' \
|
||||
| $(SORT) -V
|
||||
| tail -1
|
||||
endef
|
||||
|
||||
GITHUB_PKGS = $(patsubst %_GH_CONF,%,$(filter %_GH_CONF,$(.VARIABLES)))
|
||||
|
||||
# check-gh-conf : test updates and source directory
|
||||
# check-gh-conf-dl: removes downloads and tests above
|
||||
|
||||
# a test of many package updates may hit rate limit of 60/hr
|
||||
# https://developer.github.com/v3/#rate-limiting
|
||||
|
||||
.PHONY: check-gh-conf check-gh-conf-%
|
||||
check-gh-conf-dl: REMOVE_DOWNLOAD = true
|
||||
check-gh-conf-dl: MXE_NO_BACKUP_DL = true
|
||||
check-gh-conf-dl: check-gh-conf
|
||||
check-gh-conf-pkg-%: check-update-package-% download-only-%
|
||||
@$(PRINTF_FMT) '[prep-src]' '$(*)' | $(RTRIM)
|
||||
@($(MAKE) -f '$(MAKEFILE)' 'prepare-pkg-source-$(*)') > /dev/null
|
||||
@rm -rf '$(call TMP_DIR,$(*))'
|
||||
|
||||
# secondexpansion here since this file is included before pkg makefiles
|
||||
.SECONDEXPANSION:
|
||||
check-gh-conf: $$(addprefix check-gh-conf-pkg-,$$(GITHUB_PKGS))
|
||||
github-pkgs: $$(GITHUB_PKGS)
|
@ -0,0 +1,88 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
GIT_DIR = $(if $(patsubst .,,$($(1)_SUBDIR)) \
|
||||
,$(GITS_DIR)/$($(1)_SUBDIR),$(GITS_DIR)/$(1))
|
||||
|
||||
GIT_CMD = git \
|
||||
--work-tree='$(call GIT_DIR,$(1))' \
|
||||
--git-dir='$(call GIT_DIR,$(1))'/.git
|
||||
|
||||
PATCH_NAME = 1-fixes
|
||||
|
||||
# can't use PKG_PATCHES here, because it returns existing patches
|
||||
# while export-patch creates new patch
|
||||
PATCH_BY_NAME = $(patsubst %.mk,%-$(2).patch,$(PKG_MAKEFILES))
|
||||
|
||||
define INIT_GIT
|
||||
# unpack to gits/tmp/pkg
|
||||
rm -rf '$(GITS_DIR)/tmp'
|
||||
mkdir -p '$(GITS_DIR)/tmp/$(1)'
|
||||
cd '$(GITS_DIR)/tmp/$(1)' && $(call UNPACK_PKG_ARCHIVE,$(1))
|
||||
# if PKG_SUBDIR is ".", the following will move gits/tmp/pkg
|
||||
mv '$(abspath $(GITS_DIR)/tmp/$(1)/$($(1)_SUBDIR))' '$(call GIT_DIR,$(1))'
|
||||
rm -rf '$(GITS_DIR)/tmp'
|
||||
# rename existing .git directories if any
|
||||
find '$(call GIT_DIR,$(1))' -name .git -prune -exec sh -c 'mv "$$0" "$$0"_' {} \;
|
||||
# initialize git
|
||||
$(call GIT_CMD,$(1)) init
|
||||
$(call GIT_CMD,$(1)) add -A
|
||||
$(call GIT_CMD,$(1)) commit -m "init"
|
||||
$(call GIT_CMD,$(1)) tag dist
|
||||
endef
|
||||
|
||||
define IMPORT_PATCH
|
||||
cd '$(call GIT_DIR,$(1))' \
|
||||
&& cat '$(2)' \
|
||||
| $(SED) '/^From/,$$ !d' \
|
||||
| $(SED) s/'^From: MXE'/"From: fix@me"/'g;' \
|
||||
| $(call GIT_CMD,$(1)) am --keep-cr ;
|
||||
endef
|
||||
|
||||
define EXPORT_PATCH
|
||||
cd '$(call GIT_DIR,$(1))' \
|
||||
&& ( \
|
||||
echo 'This file is part of MXE. See LICENSE.md for licensing information.'; \
|
||||
echo ''; \
|
||||
echo 'Contains ad hoc patches for cross building.'; \
|
||||
echo ''; \
|
||||
$(call GIT_CMD,$(1)) format-patch \
|
||||
--no-numbered \
|
||||
-p \
|
||||
--no-signature \
|
||||
--stdout \
|
||||
--text \
|
||||
-M9 \
|
||||
dist..HEAD \
|
||||
| $(SED) 's/^From [0-9a-f]\{40\} /From 0000000000000000000000000000000000000000 /' \
|
||||
| $(SED) 's/^index .......\.\......../index 1111111..2222222/' \
|
||||
) > '$(PATCH_BY_NAME)'
|
||||
endef
|
||||
|
||||
init-git-%: download-only-%
|
||||
$(if $(call set_is_member,$*,$(PKGS)), \
|
||||
$(if $(wildcard $(call GIT_DIR,$*)), \
|
||||
$(error $(call GIT_DIR,$*) already exists), \
|
||||
$(call INIT_GIT,$*)), \
|
||||
$(error Package $* not found))
|
||||
|
||||
import-patch-%:
|
||||
$(if $(call set_is_member,$*,$(PKGS)), \
|
||||
$(if $(wildcard $(call GIT_DIR,$*)), \
|
||||
$(call IMPORT_PATCH,$*,$(call PATCH_BY_NAME,$*,$(PATCH_NAME))), \
|
||||
$(error $(call GIT_DIR,$*) does not exist)), \
|
||||
$(error Package $* not found))
|
||||
|
||||
import-all-patches-%:
|
||||
$(if $(call set_is_member,$*,$(PKGS)), \
|
||||
$(if $(wildcard $(call GIT_DIR,$*)), \
|
||||
$(foreach PKG_PATCH,$(call PKG_PATCHES,$*), \
|
||||
$(call IMPORT_PATCH,$*,$(PKG_PATCH))), \
|
||||
$(error $(call GIT_DIR,$*) does not exist)), \
|
||||
$(error Package $* not found))
|
||||
|
||||
export-patch-%:
|
||||
$(if $(call set_is_member,$*,$(PKGS)), \
|
||||
$(if $(wildcard $(call GIT_DIR,$*)), \
|
||||
$(call EXPORT_PATCH,$*,$(PATCH_NAME)), \
|
||||
$(error $(call GIT_DIR,$*) does not exist)), \
|
||||
$(error Package $* not found))
|
@ -0,0 +1,158 @@
|
||||
### MXE Plugins
|
||||
|
||||
#### Overview
|
||||
|
||||
MXE aims to provide a stable toolchain and feature-rich set of libraries to
|
||||
be as broadly applicable as possible. Many use cases fall outside this main
|
||||
objective and plugins are a way to bridge the gap without official framework
|
||||
support.
|
||||
|
||||
The most common cases include:
|
||||
|
||||
##### Additional packages
|
||||
|
||||
- building handy tools to run on host
|
||||
- cross-compiled interpreters and packages
|
||||
- examples of packaging complete builds for projects using MXE
|
||||
|
||||
The `apps`, `luarocks`, and `native` directories are generally supported by
|
||||
the project, each plugin package should have an identified `$(PKG)_OWNER` as
|
||||
a primary contact familiar with the specifics of the plugin.
|
||||
|
||||
##### Customisation
|
||||
|
||||
- alternate compiler versions
|
||||
- minimal features/dependencies
|
||||
- building a host toolchain
|
||||
|
||||
The `examples` and `gcc*` directories contain some starting points for
|
||||
experiments or long-lived customisations. Attempts to do such things with
|
||||
`git` branches can lead to an outdated core MXE and using plugins allows a
|
||||
nice separation while still keeping all local changes under source control.
|
||||
|
||||
These are experimental and will be deprecated over time as framework support
|
||||
is added to handle the various forms of customisation.
|
||||
|
||||
##### Internal MXE uses
|
||||
|
||||
The `native` plugin contains sub-directories with symlinks to a subset of
|
||||
packages in the parent directory. These "sub-plugins" are automatically
|
||||
activated on certain systems where the standard package-manager versions are
|
||||
known to cause issues. These are supported but subject to change or removal
|
||||
over time and should not be used directly.
|
||||
|
||||
#### Usage
|
||||
|
||||
The current implementation is very lightweight and a `plugin` is simply a
|
||||
directory containing *.mk files. When a plugin is activated with:
|
||||
|
||||
```
|
||||
make MXE_PLUGIN_DIRS=/path/to/foo
|
||||
```
|
||||
|
||||
MXE will:
|
||||
|
||||
- include all core packages
|
||||
- include `/path/to/foo/*.mk`
|
||||
- create a target for each `*.mk` file
|
||||
- create an `all-foo` target
|
||||
|
||||
Multiple plugins can be activated on the command line with an escaped
|
||||
space-separated list:
|
||||
|
||||
```
|
||||
make MXE_PLUGIN_DIRS='/path/to/foo /path/to/foo2'
|
||||
```
|
||||
|
||||
To ensure plugins are activated across multiple invocations of `make`, the
|
||||
`MXE_PLUGIN_DIRS` variable must always be specified either on the command line
|
||||
or by adding an entry in `settings.mk`
|
||||
|
||||
*N.B.* Setting `MXE_PLUGIN_DIRS` via the environment is not guaranteed to
|
||||
work in future versions.
|
||||
|
||||
For example, if you want to build keepassx from the `apps` plugin with
|
||||
a minimal qt run:
|
||||
|
||||
```
|
||||
make keepassx MXE_PLUGIN_DIRS='plugins/examples/custom-qt-min plugins/apps'
|
||||
```
|
||||
|
||||
To build all packages in `luarocks`:
|
||||
|
||||
```
|
||||
$ make all-luarocks MXE_PLUGIN_DIRS=plugins/luarocks
|
||||
```
|
||||
|
||||
To **always** use your desired plugin:
|
||||
|
||||
```
|
||||
echo 'override MXE_PLUGIN_DIRS += /path/to/foo' >> settings.mk
|
||||
```
|
||||
|
||||
Note that multiple entries in `settings.mk` should not be escaped:
|
||||
|
||||
```
|
||||
echo 'override MXE_PLUGIN_DIRS += /path/to/foo /path/to/foo2' >> settings.mk
|
||||
```
|
||||
|
||||
To review which plugins are activated, use the `gmsl-print-*` target:
|
||||
|
||||
```
|
||||
make gmsl-print-MXE_PLUGIN_DIRS MXE_PLUGIN_DIRS='/foo /bar'
|
||||
```
|
||||
|
||||
#### Creating plugins
|
||||
|
||||
The two main use cases lead to different styles of plugin. The first case of
|
||||
additional packages follows normal MXE guidelines and reviewing the contents of
|
||||
`src/*.mk`, or the `apps` and `luarocks` plugins should help getting started.
|
||||
This type of package will also work with normal MXE features such as updates
|
||||
and patches.
|
||||
|
||||
The customisation style (override/overlay) can be trickier since any arbitrary
|
||||
`make` statements can be used. Most normal variables should be overriden with
|
||||
[simply expanded variables](https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors)
|
||||
i.e. using `:=` instead of `=`. For example, to change a package version:
|
||||
|
||||
```make
|
||||
PKG := foo
|
||||
$(PKG)_VERSION := 1.2.3
|
||||
$(PKG)_CHECKSUM := 09c4c85cab...
|
||||
```
|
||||
|
||||
In this case, the behaviour of `make update-package-foo` may not be able to
|
||||
determine the correct file to update with the new version and checksum and
|
||||
`make` may not detect that the target should be rebuilt (depending on how
|
||||
files are named). This is an on-going work that will be addressed.
|
||||
|
||||
To change the set of patches applied:
|
||||
|
||||
```make
|
||||
foo_PATCHES := /path/to/first.patch /path/to/second.patch
|
||||
```
|
||||
|
||||
To apply no patches:
|
||||
|
||||
```make
|
||||
foo_PATCHES :=
|
||||
```
|
||||
|
||||
To alter dependencies and components:
|
||||
|
||||
```make
|
||||
qt_DEPS := gcc dbus jpeg libmng libpng openssl tiff zlib
|
||||
|
||||
qt_BUILD := \
|
||||
$(subst -accessibility ,-no-accessibility ,\
|
||||
$(subst -qt-sql-,-no-sql-,\
|
||||
$(qt_BUILD)))
|
||||
|
||||
qt_BUILD_SHARED := \
|
||||
$(subst -static ,-shared ,\
|
||||
$(subst -no-webkit ,-webkit ,\
|
||||
$(qt_BUILD)))
|
||||
```
|
||||
|
||||
Note the order of inclusion is indeterminate so multiple plugins should not
|
||||
be chained or attempt to add/modify the same package.
|
@ -0,0 +1,78 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Pavel Vatagin <pavelvat@gmail.com>
|
||||
Date: Sat, 5 Nov 2016 02:19:37 +0300
|
||||
Subject: [PATCH] fix clementine
|
||||
|
||||
|
||||
diff --git a/3rdparty/libprojectm/CMakeLists.txt b/3rdparty/libprojectm/CMakeLists.txt
|
||||
index 1111111..2222222 100644
|
||||
--- a/3rdparty/libprojectm/CMakeLists.txt
|
||||
+++ b/3rdparty/libprojectm/CMakeLists.txt
|
||||
@@ -174,6 +174,8 @@ if(BUNDLE_PROJECTM_PRESETS)
|
||||
COPY_ONLY
|
||||
)
|
||||
endforeach (preset)
|
||||
+ elseif (WIN32)
|
||||
+ INSTALL(FILES ${presets} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/projectm-presets)
|
||||
else (APPLE)
|
||||
INSTALL(FILES ${presets} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/clementine/projectm-presets)
|
||||
endif (APPLE)
|
||||
diff --git a/3rdparty/libprojectm/glew.h b/3rdparty/libprojectm/glew.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/3rdparty/libprojectm/glew.h
|
||||
+++ b/3rdparty/libprojectm/glew.h
|
||||
@@ -149,7 +149,7 @@ typedef unsigned short wchar_t;
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_)
|
||||
-# ifdef _WIN64
|
||||
+# if defined(_WIN64) && !defined(__MINGW32__)
|
||||
typedef __int64 ptrdiff_t;
|
||||
# else
|
||||
typedef _W64 int ptrdiff_t;
|
||||
diff --git a/3rdparty/tinysvcmdns/CMakeLists.txt b/3rdparty/tinysvcmdns/CMakeLists.txt
|
||||
index 1111111..2222222 100644
|
||||
--- a/3rdparty/tinysvcmdns/CMakeLists.txt
|
||||
+++ b/3rdparty/tinysvcmdns/CMakeLists.txt
|
||||
@@ -7,7 +7,7 @@ set(TINYSVCMDNS-SOURCES
|
||||
)
|
||||
|
||||
find_library(PTHREAD
|
||||
- pthreadGC2
|
||||
+ pthread
|
||||
)
|
||||
|
||||
add_library(tinysvcmdns STATIC
|
||||
diff --git a/ext/clementine-tagreader/CMakeLists.txt b/ext/clementine-tagreader/CMakeLists.txt
|
||||
index 1111111..2222222 100644
|
||||
--- a/ext/clementine-tagreader/CMakeLists.txt
|
||||
+++ b/ext/clementine-tagreader/CMakeLists.txt
|
||||
@@ -27,10 +27,10 @@ add_executable(clementine-tagreader
|
||||
|
||||
target_link_libraries(clementine-tagreader
|
||||
${TAGLIB_LIBRARIES}
|
||||
- ${QT_QTCORE_LIBRARY}
|
||||
- ${QT_QTNETWORK_LIBRARY}
|
||||
libclementine-common
|
||||
libclementine-tagreader
|
||||
+ ${QT_QTCORE_LIBRARY}
|
||||
+ ${QT_QTNETWORK_LIBRARY}
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -1343,6 +1343,7 @@ if (WIN32)
|
||||
tinysvcmdns
|
||||
qtwin
|
||||
dsound
|
||||
+ ${QT_QTGUI_LIBRARY}
|
||||
)
|
||||
endif (WIN32)
|
||||
|
@ -0,0 +1,91 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# lconvert and lupdate are not provided by MXE for Qt4,
|
||||
# so for Debian/Ubuntu you need install packages qt4-linguist-tools
|
||||
# (this package contains lupdate and lrelease) and qt4-dev-tools
|
||||
# (this package contains lconvert):
|
||||
# apt-get install qt4-linguist-tools qt4-dev-tools
|
||||
# Or you may use lupdate, lrelease, lconvert from Qt5:
|
||||
# apt-get install qttools5-dev-tools
|
||||
|
||||
PKG := clementine_qt4
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.3.1
|
||||
$(PKG)_CHECKSUM := f885931a9ab7c88607d07b50c64fcce46fc05f13dd2c0a04188c94eff938f37c
|
||||
$(PKG)_SUBDIR := Clementine-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := clementine-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://github.com/clementine-player/clementine/archive/$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_WEBSITE := https://www.clementine-player.org/
|
||||
$(PKG)_OWNER := https://github.com/pavelvat
|
||||
$(PKG)_DEPS := gcc boost chromaprint cryptopp dlfcn-win32 fftw glew gst-libav gst-plugins-bad \
|
||||
gst-plugins-good gst-plugins-ugly libarchive libechonest libid3tag liblastfm_qt4 \
|
||||
libmpcdec libplist libusb1 protobuf qtsparkle_qt4 sparsehash
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, clementine-player/clementine)
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)' \
|
||||
-DCMAKE_INSTALL_PREFIX=$(PREFIX)/$(TARGET)/apps/$(PKG)
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j $(JOBS)
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
|
||||
|
||||
$(if $(BUILD_SHARED),
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstapetag.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstapp.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstasf.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstaudioconvert.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstaudiofx.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstaudioparsers.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstaudioresample.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstaudiotestsrc.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstautodetect.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstcdio.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstcoreelements.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstdirectsoundsink.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstequalizer.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstfaad.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstflac.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstgdp.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstgio.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgsticydemux.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstid3demux.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstisomp4.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstlame.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstlibav.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstmad.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstmms.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstogg.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstopus.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstplayback.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstreplaygain.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstsouphttpsrc.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstspectrum.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstspeex.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgsttaglib.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgsttcp.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgsttypefindfunctions.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstudp.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstvolume.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstvorbis.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstwavpack.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/bin/libgstwavparse.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins'
|
||||
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/imageformats'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/qt/plugins/imageformats/qgif4.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/imageformats'
|
||||
$(INSTALL) '$(PREFIX)/$(TARGET)/qt/plugins/imageformats/qjpeg4.dll' '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/imageformats'
|
||||
|
||||
'$(TOP_DIR)/tools/copydlldeps.sh' -c \
|
||||
-d '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin' \
|
||||
-F '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin' \
|
||||
-F '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/gstreamer-plugins' \
|
||||
-F '$(PREFIX)/$(TARGET)/apps/$(PKG)/bin/imageformats' \
|
||||
-X '$(PREFIX)/$(TARGET)/apps' \
|
||||
-R '$(PREFIX)/$(TARGET)';
|
||||
)
|
||||
endef
|
||||
|
||||
# libechonest doesn't support static builds
|
||||
$(PKG)_BUILD_STATIC =
|
@ -0,0 +1,26 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
From e941cfd42870fe214f8c44cd5e4d8ee6893b0904 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Fri, 25 Sep 2015 10:19:17 +0200
|
||||
Subject: [PATCH] don't discard CONFIG set by qmake
|
||||
|
||||
See https://github.com/mxe/mxe/commit/6c561c5f3307944d7b6d7ec3de732b25bf69ed00
|
||||
---
|
||||
src/src.pro | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/src.pro b/src/src.pro
|
||||
index 7644b93..827741d 100644
|
||||
--- a/src/src.pro
|
||||
+++ b/src/src.pro
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
-CONFIG = qt uic resources thread stl warn_on
|
||||
+CONFIG += qt uic resources thread stl warn_on
|
||||
QT += xml
|
||||
|
||||
*-g++ : QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare
|
||||
--
|
||||
1.7.10.4
|
||||
|
@ -0,0 +1,25 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := keepassx
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 0.4.3
|
||||
$(PKG)_CHECKSUM := cd901a0611ce57e62cf6df7eeeb1b690b5232302bdad8626994eb54adcfa1e85
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://www.keepassx.org/releases/$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://www.keepassx.org
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_DEPS := gcc qt
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://www.keepassx.org/downloads/' | \
|
||||
$(SED) -n 's,.*keepassx-\([0-9][^"]*\)\.tar.*,\1,p' | \
|
||||
head -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(1)' && '$(TARGET)-qmake-qt4' \
|
||||
"PREFIX=$(PREFIX)/$(TARGET)/bin/"
|
||||
$(MAKE) -C '$(1)' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(1)' -j 1 install
|
||||
endef
|
@ -0,0 +1,6 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# enable native build of luajit for wrk
|
||||
# leave build rule in src/luajit.mk for other uses (i.e. build-pkg)
|
||||
|
||||
luajit_TARGETS := $(BUILD) $(MXE_TARGETS)
|
@ -0,0 +1,30 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := msmtp
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.6.6
|
||||
$(PKG)_CHECKSUM := da15db1f62bd0201fce5310adb89c86188be91cd745b7cb3b62b81a501e7fb5e
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz
|
||||
$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_OWNER := https://github.com/andrew-strong
|
||||
$(PKG)_DEPS := gcc gnutls libgcrypt libgpg_error libgsasl libiconv libidn libntlm
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://sourceforge.net/projects/msmtp/files/msmtp/' | \
|
||||
$(SED) -n 's,.*/\([0-9][^"]*\)/".*,\1,p' | \
|
||||
head -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
|
||||
$(MXE_CONFIGURE_OPTS) \
|
||||
--infodir='$(BUILD_DIR)/sink' \
|
||||
--disable-nls \
|
||||
--without-libsecret \
|
||||
--without-macosx-keyring \
|
||||
--with-tls=gnutls \
|
||||
--with-libidn
|
||||
$(MAKE) -C $(BUILD_DIR) -j '$(JOBS)'
|
||||
$(MAKE) -C $(BUILD_DIR) -j 1 install $(MXE_DISABLE_DOCS)
|
||||
endef
|
@ -0,0 +1,121 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 30 Aug 2015 00:28:50 +0200
|
||||
Subject: [PATCH] do not check qmake existance
|
||||
|
||||
Fix ./configure error:
|
||||
|
||||
checking for mxe/usr/i686-w64-mingw32.static/qt/bin/qmake...
|
||||
configure: error: cannot check for file existence when
|
||||
cross compiling
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 1111111..2222222 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -4500,7 +4500,7 @@ if eval \${$as_ac_File+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
test "$cross_compiling" = yes &&
|
||||
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
+ echo "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
if test -r "$QT_QMAKE/qmake"; then
|
||||
eval "$as_ac_File=yes"
|
||||
else
|
||||
@@ -4520,7 +4520,7 @@ if eval \${$as_ac_File+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
test "$cross_compiling" = yes &&
|
||||
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
+ echo "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
if test -r "$QT_QMAKE/qmake-qt5"; then
|
||||
eval "$as_ac_File=yes"
|
||||
else
|
||||
@@ -4617,7 +4617,7 @@ if eval \${$as_ac_File+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
test "$cross_compiling" = yes &&
|
||||
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
+ echo "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
if test -r "$QT_QMAKE/qmake"; then
|
||||
eval "$as_ac_File=yes"
|
||||
else
|
||||
@@ -4637,7 +4637,7 @@ if eval \${$as_ac_File+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
test "$cross_compiling" = yes &&
|
||||
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
+ echo "cannot check for file existence when cross compiling" "$LINENO" 5
|
||||
if test -r "$QT_QMAKE/qmake-qt4"; then
|
||||
eval "$as_ac_File=yes"
|
||||
else
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 29 May 2016 23:35:25 +0200
|
||||
Subject: [PATCH] link with boost_random and boost_chrono
|
||||
|
||||
libtorrent-rasterbar 1.1.0 uses them
|
||||
|
||||
diff --git a/winconf-mingw.pri b/winconf-mingw.pri
|
||||
index 1111111..2222222 100644
|
||||
--- a/winconf-mingw.pri
|
||||
+++ b/winconf-mingw.pri
|
||||
@@ -23,11 +23,15 @@ RC_FILE = qbittorrent_mingw.rc
|
||||
# Adapt the lib names/versions accordingly
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += libtorrent-rasterbar \
|
||||
+ libboost_random-mt \
|
||||
+ libboost_chrono-mt \
|
||||
libboost_system-mt \
|
||||
libboost_filesystem-mt \
|
||||
libboost_thread_win32-mt
|
||||
} else {
|
||||
LIBS += libtorrent-rasterbar \
|
||||
+ libboost_random-mt \
|
||||
+ libboost_chrono-mt \
|
||||
libboost_system-mt \
|
||||
libboost_filesystem-mt \
|
||||
libboost_thread_win32-mt
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Mon, 30 May 2016 00:09:20 +0200
|
||||
Subject: [PATCH] disable BOOST_ASIO_SEPARATE_COMPILATION
|
||||
|
||||
After upgrading libtorrent-rasterbar to 1.1.0, qbittorrent fails to link
|
||||
main executable with undefined symbols in boost_asio:
|
||||
|
||||
./release/application.o:application.cpp:(.text.startup+0x83):
|
||||
undefined reference to `boost::asio::detail::winsock_init_base::startup
|
||||
(boost::asio::detail::winsock_init_base::data&, unsigned char,
|
||||
unsigned char)'
|
||||
|
||||
diff --git a/cmake/Modules/winconf.cmake b/cmake/Modules/winconf.cmake
|
||||
index 1111111..2222222 100644
|
||||
--- a/cmake/Modules/winconf.cmake
|
||||
+++ b/cmake/Modules/winconf.cmake
|
||||
@@ -5,7 +5,6 @@
|
||||
set(LibtorrentRasterbar_USE_STATIC_LIBS True)
|
||||
set(LibtorrentRasterbar_CUSTOM_DEFINITIONS
|
||||
-DBOOST_ALL_NO_LIB -DBOOST_ASIO_HASH_MAP_BUCKETS=1021
|
||||
- -DBOOST_ASIO_SEPARATE_COMPILATION
|
||||
-DBOOST_EXCEPTION_DISABLE
|
||||
-DBOOST_SYSTEM_STATIC_LINK=1
|
||||
-DTORRENT_USE_OPENSSL
|
||||
diff --git a/winconf.pri b/winconf.pri
|
||||
index 1111111..2222222 100644
|
||||
--- a/winconf.pri
|
||||
+++ b/winconf.pri
|
||||
@@ -21,7 +21,6 @@ LIBS += $$quote(-LC:/qBittorrent/openssl/lib)
|
||||
# LIBTORRENT DEFINES
|
||||
DEFINES += BOOST_ALL_NO_LIB
|
||||
DEFINES += BOOST_ASIO_HASH_MAP_BUCKETS=1021
|
||||
-DEFINES += BOOST_ASIO_SEPARATE_COMPILATION
|
||||
# After 1.55 some Windows users reported regular UI freezes.
|
||||
# This makes ASIO use the pre-1.56 way of doing things. See issue #2003
|
||||
DEFINES += BOOST_ASIO_DISABLE_CONNECTEX
|
@ -0,0 +1,31 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := qbittorrent
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 3.3.4
|
||||
$(PKG)_CHECKSUM := c0d0d4b72c240f113b59a061146803bc1b7926d3d7f39b06b50a4d26f5ad91b8
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.xz
|
||||
$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$(PKG)-$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://qbittorrent.org/
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_DEPS := gcc boost libtorrent-rasterbar qt
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://www.qbittorrent.org/download.php' | \
|
||||
$(SED) -n 's,.*qbittorrent-\([0-9][^"]*\)\.tar.*,\1,p' | \
|
||||
head -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(1)' && \
|
||||
QMAKE_LRELEASE='$(PREFIX)/$(TARGET)/qt/bin/lrelease' \
|
||||
./configure \
|
||||
$(MXE_CONFIGURE_OPTS) \
|
||||
--with-qt4=yes \
|
||||
--with-boost='$(PREFIX)/$(TARGET)'
|
||||
$(MAKE) -C '$(1)' -j '$(JOBS)'
|
||||
cp '$(1)'/src/release/qbittorrent.exe '$(PREFIX)/$(TARGET)/bin/'
|
||||
endef
|
||||
|
||||
$(PKG)_BUILD_SHARED =
|
@ -0,0 +1,28 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := ricochet
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.1.4
|
||||
$(PKG)_CHECKSUM := f5f32caa3480def1de5c93010c6bf5f5789ddcba34bf09fc0feab67696d0c374
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION)-src.tar.bz2
|
||||
$(PKG)_URL := https://ricochet.im/releases/$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://ricochet.im/
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_DEPS := gcc openssl protobuf qtbase qtdeclarative qtmultimedia qtquickcontrols qttools
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, ricochet-im/ricochet, v)
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
# TODO: add libasan and libubsan and let ricochet use them.
|
||||
# See https://github.com/ricochet-im/ricochet/blob/master/BUILDING.md#hardening
|
||||
cd '$(BUILD_DIR)' && \
|
||||
'$(TARGET)-qmake-qt5' \
|
||||
OPENSSLDIR='$(PREFIX)/$(TARGET)' \
|
||||
PROTOBUFDIR='$(PREFIX)/$(TARGET)' \
|
||||
'$(SOURCE_DIR)'
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
|
||||
cp '$(BUILD_DIR)'/release/ricochet.exe '$(PREFIX)/$(TARGET)/bin/'
|
||||
endef
|
@ -0,0 +1,28 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := tor
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 0.3.0.7
|
||||
$(PKG)_CHECKSUM := 9640c4448ef3cad7237c68ed6984e705db8fb2b9d6bb74c8815d01bb06527d02
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://torproject.org/dist/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://torproject.org/
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_DEPS := gcc libevent openssl zlib
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://torproject.org/download/download' | \
|
||||
$(SED) -n 's,.*tor-\([0-9][^"]*\)\.tar.*,\1,p' | \
|
||||
head -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(BUILD_DIR)' && \
|
||||
LIBS="`'$(TARGET)-pkg-config' --libs-only-l openssl`" \
|
||||
'$(SOURCE_DIR)/configure' \
|
||||
$(MXE_CONFIGURE_OPTS)
|
||||
$(SED) 's@#define HAVE_SYS_MMAN_H 1@// Disabled in MXE #define HAVE_SYS_MMAN_H 1@' -i '$(BUILD_DIR)/orconfig.h'
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(MXE_DISABLE_DOCS)
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j 1 install $(MXE_DISABLE_DOCS)
|
||||
endef
|
@ -0,0 +1,678 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 20 Mar 2016 16:36:20 +0100
|
||||
Subject: [PATCH] rename conflicting constants
|
||||
|
||||
|
||||
diff --git a/src/net.c b/src/net.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/net.c
|
||||
+++ b/src/net.c
|
||||
@@ -7,29 +7,29 @@
|
||||
#include "net.h"
|
||||
|
||||
status sock_connect(connection *c) {
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
status sock_close(connection *c) {
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
status sock_read(connection *c, size_t *n) {
|
||||
ssize_t r = read(c->fd, c->buf, sizeof(c->buf));
|
||||
*n = (size_t) r;
|
||||
- return r >= 0 ? OK : ERROR;
|
||||
+ return r >= 0 ? WRK_OK : WRK_ERROR;
|
||||
}
|
||||
|
||||
status sock_write(connection *c, char *buf, size_t len, size_t *n) {
|
||||
ssize_t r;
|
||||
if ((r = write(c->fd, buf, len)) == -1) {
|
||||
switch (errno) {
|
||||
- case EAGAIN: return RETRY;
|
||||
- default: return ERROR;
|
||||
+ case EAGAIN: return WRK_RETRY;
|
||||
+ default: return WRK_ERROR;
|
||||
}
|
||||
}
|
||||
*n = (size_t) r;
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
size_t sock_readable(connection *c) {
|
||||
diff --git a/src/net.h b/src/net.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/net.h
|
||||
+++ b/src/net.h
|
||||
@@ -7,9 +7,9 @@
|
||||
#include "wrk.h"
|
||||
|
||||
typedef enum {
|
||||
- OK,
|
||||
- ERROR,
|
||||
- RETRY
|
||||
+ WRK_OK,
|
||||
+ WRK_ERROR,
|
||||
+ WRK_RETRY
|
||||
} status;
|
||||
|
||||
struct sock {
|
||||
diff --git a/src/ssl.c b/src/ssl.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/ssl.c
|
||||
+++ b/src/ssl.c
|
||||
@@ -54,44 +54,44 @@ status ssl_connect(connection *c) {
|
||||
SSL_set_fd(c->ssl, c->fd);
|
||||
if ((r = SSL_connect(c->ssl)) != 1) {
|
||||
switch (SSL_get_error(c->ssl, r)) {
|
||||
- case SSL_ERROR_WANT_READ: return RETRY;
|
||||
- case SSL_ERROR_WANT_WRITE: return RETRY;
|
||||
- default: return ERROR;
|
||||
+ case SSL_ERROR_WANT_READ: return WRK_RETRY;
|
||||
+ case SSL_ERROR_WANT_WRITE: return WRK_RETRY;
|
||||
+ default: return WRK_ERROR;
|
||||
}
|
||||
}
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
status ssl_close(connection *c) {
|
||||
SSL_shutdown(c->ssl);
|
||||
SSL_clear(c->ssl);
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
status ssl_read(connection *c, size_t *n) {
|
||||
int r;
|
||||
if ((r = SSL_read(c->ssl, c->buf, sizeof(c->buf))) <= 0) {
|
||||
switch (SSL_get_error(c->ssl, r)) {
|
||||
- case SSL_ERROR_WANT_READ: return RETRY;
|
||||
- case SSL_ERROR_WANT_WRITE: return RETRY;
|
||||
- default: return ERROR;
|
||||
+ case SSL_ERROR_WANT_READ: return WRK_RETRY;
|
||||
+ case SSL_ERROR_WANT_WRITE: return WRK_RETRY;
|
||||
+ default: return WRK_ERROR;
|
||||
}
|
||||
}
|
||||
*n = (size_t) r;
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
status ssl_write(connection *c, char *buf, size_t len, size_t *n) {
|
||||
int r;
|
||||
if ((r = SSL_write(c->ssl, buf, len)) <= 0) {
|
||||
switch (SSL_get_error(c->ssl, r)) {
|
||||
- case SSL_ERROR_WANT_READ: return RETRY;
|
||||
- case SSL_ERROR_WANT_WRITE: return RETRY;
|
||||
- default: return ERROR;
|
||||
+ case SSL_ERROR_WANT_READ: return WRK_RETRY;
|
||||
+ case SSL_ERROR_WANT_WRITE: return WRK_RETRY;
|
||||
+ default: return WRK_ERROR;
|
||||
}
|
||||
}
|
||||
*n = (size_t) r;
|
||||
- return OK;
|
||||
+ return WRK_OK;
|
||||
}
|
||||
|
||||
size_t ssl_readable(connection *c) {
|
||||
diff --git a/src/wrk.c b/src/wrk.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/wrk.c
|
||||
+++ b/src/wrk.c
|
||||
@@ -349,9 +349,9 @@ static void socket_connected(aeEventLoop *loop, int fd, void *data, int mask) {
|
||||
connection *c = data;
|
||||
|
||||
switch (sock.connect(c)) {
|
||||
- case OK: break;
|
||||
- case ERROR: goto error;
|
||||
- case RETRY: return;
|
||||
+ case WRK_OK: break;
|
||||
+ case WRK_ERROR: goto error;
|
||||
+ case WRK_RETRY: return;
|
||||
}
|
||||
|
||||
http_parser_init(&c->parser, HTTP_RESPONSE);
|
||||
@@ -384,9 +384,9 @@ static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {
|
||||
size_t n;
|
||||
|
||||
switch (sock.write(c, buf, len, &n)) {
|
||||
- case OK: break;
|
||||
- case ERROR: goto error;
|
||||
- case RETRY: return;
|
||||
+ case WRK_OK: break;
|
||||
+ case WRK_ERROR: goto error;
|
||||
+ case WRK_RETRY: return;
|
||||
}
|
||||
|
||||
c->written += n;
|
||||
@@ -408,9 +408,9 @@ static void socket_readable(aeEventLoop *loop, int fd, void *data, int mask) {
|
||||
|
||||
do {
|
||||
switch (sock.read(c, &n)) {
|
||||
- case OK: break;
|
||||
- case ERROR: goto error;
|
||||
- case RETRY: return;
|
||||
+ case WRK_OK: break;
|
||||
+ case WRK_ERROR: goto error;
|
||||
+ case WRK_RETRY: return;
|
||||
}
|
||||
|
||||
if (http_parser_execute(&c->parser, &parser_settings, c->buf, n) != n) goto error;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 20 Mar 2016 21:34:38 +0100
|
||||
Subject: [PATCH] rename zcalloc (conflict with zlib)
|
||||
|
||||
|
||||
diff --git a/src/stats.c b/src/stats.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/stats.c
|
||||
+++ b/src/stats.c
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
stats *stats_alloc(uint64_t max) {
|
||||
uint64_t limit = max + 1;
|
||||
- stats *s = zcalloc(sizeof(stats) + sizeof(uint64_t) * limit);
|
||||
+ stats *s = zmalloc_calloc(sizeof(stats) + sizeof(uint64_t) * limit);
|
||||
s->limit = limit;
|
||||
s->min = UINT64_MAX;
|
||||
return s;
|
||||
diff --git a/src/wrk.c b/src/wrk.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/wrk.c
|
||||
+++ b/src/wrk.c
|
||||
@@ -88,7 +88,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
statistics.latency = stats_alloc(cfg.timeout * 1000);
|
||||
statistics.requests = stats_alloc(MAX_THREAD_RATE_S);
|
||||
- thread *threads = zcalloc(cfg.threads * sizeof(thread));
|
||||
+ thread *threads = zmalloc_calloc(cfg.threads * sizeof(thread));
|
||||
|
||||
lua_State *L = script_create(cfg.script, url, headers);
|
||||
if (!script_resolve(L, host, service)) {
|
||||
@@ -204,7 +204,7 @@ void *thread_main(void *arg) {
|
||||
script_request(thread->L, &request, &length);
|
||||
}
|
||||
|
||||
- thread->cs = zcalloc(thread->connections * sizeof(connection));
|
||||
+ thread->cs = zmalloc_calloc(thread->connections * sizeof(connection));
|
||||
connection *c = thread->cs;
|
||||
|
||||
for (uint64_t i = 0; i < thread->connections; i++, c++) {
|
||||
@@ -436,7 +436,7 @@ static char *copy_url_part(char *url, struct http_parser_url *parts, enum http_p
|
||||
if (parts->field_set & (1 << field)) {
|
||||
uint16_t off = parts->field_data[field].off;
|
||||
uint16_t len = parts->field_data[field].len;
|
||||
- part = zcalloc(len + 1 * sizeof(char));
|
||||
+ part = zmalloc_calloc(len + 1 * sizeof(char));
|
||||
memcpy(part, &url[off], len);
|
||||
}
|
||||
|
||||
diff --git a/src/zmalloc.c b/src/zmalloc.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/zmalloc.c
|
||||
+++ b/src/zmalloc.c
|
||||
@@ -107,7 +107,7 @@ void *zmalloc(size_t size) {
|
||||
#endif
|
||||
}
|
||||
|
||||
-void *zcalloc(size_t size) {
|
||||
+void *zmalloc_calloc(size_t size) {
|
||||
void *ptr = calloc(1, size+PREFIX_SIZE);
|
||||
|
||||
if (!ptr) zmalloc_oom(size);
|
||||
diff --git a/src/zmalloc.h b/src/zmalloc.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/zmalloc.h
|
||||
+++ b/src/zmalloc.h
|
||||
@@ -67,7 +67,7 @@
|
||||
#endif
|
||||
|
||||
void *zmalloc(size_t size);
|
||||
-void *zcalloc(size_t size);
|
||||
+void *zmalloc_calloc(size_t size);
|
||||
void *zrealloc(void *ptr, size_t size);
|
||||
void zfree(void *ptr);
|
||||
char *zstrdup(const char *s);
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Tue, 22 Mar 2016 23:04:35 +0100
|
||||
Subject: [PATCH] allow to specify EXTRA_CFLAGS and EXTRA_LIBS
|
||||
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1111111..2222222 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,5 +1,5 @@
|
||||
-CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT
|
||||
-LIBS := -lpthread -lm -lcrypto -lssl
|
||||
+CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT $(EXTRA_CFLAGS)
|
||||
+LIBS := -lpthread -lm -lcrypto -lssl $(EXTRA_LIBS)
|
||||
|
||||
TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
|
||||
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Tue, 22 Mar 2016 23:05:26 +0100
|
||||
Subject: [PATCH] reorder -lssl and -lcrypto
|
||||
|
||||
See http://stackoverflow.com/a/27136346
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1111111..2222222 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,5 +1,5 @@
|
||||
CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT $(EXTRA_CFLAGS)
|
||||
-LIBS := -lpthread -lm -lcrypto -lssl $(EXTRA_LIBS)
|
||||
+LIBS := -lpthread -lm -lssl -lcrypto $(EXTRA_LIBS)
|
||||
|
||||
TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
|
||||
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Tue, 22 Mar 2016 23:14:32 +0100
|
||||
Subject: [PATCH] option to use external installation of LuaJIT
|
||||
|
||||
LUA_PATH is provided to avoid changing directory to LuaJIT's tree.
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1111111..2222222 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -25,9 +25,11 @@ ODIR := obj
|
||||
OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o
|
||||
|
||||
LDIR = deps/luajit/src
|
||||
-LIBS := -lluajit $(LIBS)
|
||||
-CFLAGS += -I$(LDIR)
|
||||
-LDFLAGS += -L$(LDIR)
|
||||
+LUA_PATH = $(LDIR)/?.lua # for luajit -b to work
|
||||
+LUAJIT = $(LDIR)/luajit
|
||||
+LUAJIT_A = $(LDIR)/libluajit.a
|
||||
+LUAJIT_I = $(LDIR)
|
||||
+CFLAGS += -I$(LUAJIT_I)
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
@@ -37,16 +39,16 @@ clean:
|
||||
|
||||
$(BIN): $(OBJ)
|
||||
@echo LINK $(BIN)
|
||||
- @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
+ @$(CC) $(LDFLAGS) -o $@ $^ $(LUAJIT_A) $(LIBS)
|
||||
|
||||
-$(OBJ): config.h Makefile $(LDIR)/libluajit.a | $(ODIR)
|
||||
+$(OBJ): config.h Makefile $(LUAJIT_A) | $(ODIR)
|
||||
|
||||
$(ODIR):
|
||||
@mkdir -p $@
|
||||
|
||||
$(ODIR)/bytecode.o: src/wrk.lua
|
||||
@echo LUAJIT $<
|
||||
- @$(SHELL) -c 'cd $(LDIR) && ./luajit -b $(CURDIR)/$< $(CURDIR)/$@'
|
||||
+ @LUA_PATH=$(LUA_PATH) $(LUAJIT) -b $(CURDIR)/$< $(CURDIR)/$@
|
||||
|
||||
$(ODIR)/%.o : %.c
|
||||
@echo CC $<
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Tue, 22 Mar 2016 23:21:51 +0100
|
||||
Subject: [PATCH] embed bytecode via header instead of object file
|
||||
|
||||
Embedding via object file requires -Wl,-E which doesn't work on MinGW.
|
||||
Embedding via header is more portable.
|
||||
|
||||
diff --git a/.gitignore b/.gitignore
|
||||
index 1111111..2222222 100644
|
||||
--- a/.gitignore
|
||||
+++ b/.gitignore
|
||||
@@ -1,6 +1,7 @@
|
||||
*.o
|
||||
*.a
|
||||
wrk
|
||||
+src/bytecode.h
|
||||
|
||||
deps/luajit/src/host/buildvm
|
||||
deps/luajit/src/host/buildvm_arch.h
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1111111..2222222 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -11,10 +11,8 @@ else ifeq ($(TARGET), darwin)
|
||||
else ifeq ($(TARGET), linux)
|
||||
CFLAGS += -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE
|
||||
LIBS += -ldl
|
||||
- LDFLAGS += -Wl,-E
|
||||
else ifeq ($(TARGET), freebsd)
|
||||
CFLAGS += -D_DECLARE_C99_LDBL_MATH
|
||||
- LDFLAGS += -Wl,-E
|
||||
endif
|
||||
|
||||
SRC := wrk.c net.c ssl.c aprintf.c stats.c script.c units.c \
|
||||
@@ -22,7 +20,7 @@ SRC := wrk.c net.c ssl.c aprintf.c stats.c script.c units.c \
|
||||
BIN := wrk
|
||||
|
||||
ODIR := obj
|
||||
-OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o
|
||||
+OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC))
|
||||
|
||||
LDIR = deps/luajit/src
|
||||
LUA_PATH = $(LDIR)/?.lua # for luajit -b to work
|
||||
@@ -41,12 +39,12 @@ $(BIN): $(OBJ)
|
||||
@echo LINK $(BIN)
|
||||
@$(CC) $(LDFLAGS) -o $@ $^ $(LUAJIT_A) $(LIBS)
|
||||
|
||||
-$(OBJ): config.h Makefile $(LUAJIT_A) | $(ODIR)
|
||||
+$(OBJ): config.h bytecode.h Makefile $(LUAJIT_A) | $(ODIR)
|
||||
|
||||
$(ODIR):
|
||||
@mkdir -p $@
|
||||
|
||||
-$(ODIR)/bytecode.o: src/wrk.lua
|
||||
+src/bytecode.h: src/wrk.lua
|
||||
@echo LUAJIT $<
|
||||
@LUA_PATH=$(LUA_PATH) $(LUAJIT) -b $(CURDIR)/$< $(CURDIR)/$@
|
||||
|
||||
diff --git a/src/script.c b/src/script.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/script.c
|
||||
+++ b/src/script.c
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "script.h"
|
||||
#include "http_parser.h"
|
||||
#include "zmalloc.h"
|
||||
+#include "bytecode.h"
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
@@ -48,7 +49,17 @@ static const struct luaL_reg threadlib[] = {
|
||||
lua_State *script_create(char *file, char *url, char **headers) {
|
||||
lua_State *L = luaL_newstate();
|
||||
luaL_openlibs(L);
|
||||
- (void) luaL_dostring(L, "wrk = require \"wrk\"");
|
||||
+
|
||||
+ // Taken from http://stackoverflow.com/a/19426724
|
||||
+ lua_getglobal(L, "package");
|
||||
+ lua_getfield(L, -1, "preload");
|
||||
+ luaL_loadbuffer(L, luaJIT_BC_wrk, luaJIT_BC_wrk_SIZE, NULL);
|
||||
+ lua_setfield(L, -2, "wrk");
|
||||
+ lua_pop(L, 2);
|
||||
+
|
||||
+ if (luaL_dostring(L, "wrk = require \"wrk\"")) {
|
||||
+ fprintf(stderr, "Error in wrk.lua: %s\n", lua_tostring(L, -1));
|
||||
+ }
|
||||
|
||||
luaL_newmetatable(L, "wrk.addr");
|
||||
luaL_register(L, NULL, addrlib);
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Tue, 22 Mar 2016 23:28:09 +0100
|
||||
Subject: [PATCH] use send/recv for sockets instead of write/read
|
||||
|
||||
write/read returns Bad file descriptor for sockets in MinGW.
|
||||
|
||||
diff --git a/src/net.c b/src/net.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/net.c
|
||||
+++ b/src/net.c
|
||||
@@ -15,14 +15,14 @@ status sock_close(connection *c) {
|
||||
}
|
||||
|
||||
status sock_read(connection *c, size_t *n) {
|
||||
- ssize_t r = read(c->fd, c->buf, sizeof(c->buf));
|
||||
+ ssize_t r = recv(c->fd, c->buf, sizeof(c->buf), 0);
|
||||
*n = (size_t) r;
|
||||
return r >= 0 ? WRK_OK : WRK_ERROR;
|
||||
}
|
||||
|
||||
status sock_write(connection *c, char *buf, size_t len, size_t *n) {
|
||||
ssize_t r;
|
||||
- if ((r = write(c->fd, buf, len)) == -1) {
|
||||
+ if ((r = send(c->fd, buf, len, 0)) == -1) {
|
||||
switch (errno) {
|
||||
case EAGAIN: return WRK_RETRY;
|
||||
default: return WRK_ERROR;
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Wed, 23 Mar 2016 22:48:52 +0100
|
||||
Subject: [PATCH] compatibility with MinGW
|
||||
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1111111..2222222 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -13,6 +13,8 @@ else ifeq ($(TARGET), linux)
|
||||
LIBS += -ldl
|
||||
else ifeq ($(TARGET), freebsd)
|
||||
CFLAGS += -D_DECLARE_C99_LDBL_MATH
|
||||
+else ifeq ($(TARGET), mingw)
|
||||
+ CFLAGS += -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE
|
||||
endif
|
||||
|
||||
SRC := wrk.c net.c ssl.c aprintf.c stats.c script.c units.c \
|
||||
diff --git a/src/ae.c b/src/ae.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/ae.c
|
||||
+++ b/src/ae.c
|
||||
@@ -35,7 +35,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
+#ifndef __WIN32__
|
||||
#include <poll.h>
|
||||
+#else
|
||||
+#include <winsock2.h>
|
||||
+#endif
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
@@ -395,6 +399,7 @@ int aeProcessEvents(aeEventLoop *eventLoop, int flags)
|
||||
return processed; /* return the number of processed file/time events */
|
||||
}
|
||||
|
||||
+#ifndef __WIN32__
|
||||
/* Wait for millseconds until the given file descriptor becomes
|
||||
* writable/readable/exception */
|
||||
int aeWait(int fd, int mask, long long milliseconds) {
|
||||
@@ -416,6 +421,7 @@ int aeWait(int fd, int mask, long long milliseconds) {
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
void aeMain(aeEventLoop *eventLoop) {
|
||||
eventLoop->stop = 0;
|
||||
diff --git a/src/main.h b/src/main.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/main.h
|
||||
+++ b/src/main.h
|
||||
@@ -6,8 +6,14 @@
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <math.h>
|
||||
+#ifndef __WIN32__
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
+#include <sys/uio.h>
|
||||
+#else
|
||||
+#include <winsock2.h>
|
||||
+#include <ws2tcpip.h>
|
||||
+#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@@ -17,7 +23,6 @@
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/time.h>
|
||||
-#include <sys/uio.h>
|
||||
|
||||
#include "ssl.h"
|
||||
#include "aprintf.h"
|
||||
diff --git a/src/net.c b/src/net.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/net.c
|
||||
+++ b/src/net.c
|
||||
@@ -2,7 +2,12 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
+
|
||||
+#ifndef __WIN32__
|
||||
#include <sys/ioctl.h>
|
||||
+#else
|
||||
+#include <winsock2.h>
|
||||
+#endif
|
||||
|
||||
#include "net.h"
|
||||
|
||||
@@ -33,7 +38,13 @@ status sock_write(connection *c, char *buf, size_t len, size_t *n) {
|
||||
}
|
||||
|
||||
size_t sock_readable(connection *c) {
|
||||
+#ifndef __WIN32__
|
||||
int n, rc;
|
||||
rc = ioctl(c->fd, FIONREAD, &n);
|
||||
+#else
|
||||
+ unsigned long n;
|
||||
+ int rc;
|
||||
+ rc = ioctlsocket(c->fd, FIONREAD, &n);
|
||||
+#endif
|
||||
return rc == -1 ? 0 : n;
|
||||
}
|
||||
diff --git a/src/wrk.c b/src/wrk.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/wrk.c
|
||||
+++ b/src/wrk.c
|
||||
@@ -57,6 +57,14 @@ static void usage() {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
+#ifdef __WIN32__
|
||||
+ WSADATA wsaData;
|
||||
+ if (WSAStartup(0x202, &wsaData) != 0) {
|
||||
+ fprintf(stderr, "Failed to initialize WSA\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
char *url, **headers = zmalloc(argc * sizeof(char *));
|
||||
struct http_parser_url parts = {};
|
||||
|
||||
@@ -83,7 +91,9 @@ int main(int argc, char **argv) {
|
||||
sock.readable = ssl_readable;
|
||||
}
|
||||
|
||||
+#ifndef __WIN32__
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
+#endif
|
||||
signal(SIGINT, SIG_IGN);
|
||||
|
||||
statistics.latency = stats_alloc(cfg.timeout * 1000);
|
||||
@@ -99,7 +109,12 @@ int main(int argc, char **argv) {
|
||||
|
||||
for (uint64_t i = 0; i < cfg.threads; i++) {
|
||||
thread *t = &threads[i];
|
||||
+#ifndef __WIN32__
|
||||
t->loop = aeCreateEventLoop(10 + cfg.connections * 3);
|
||||
+#else
|
||||
+ // fd on Windows doesn't start from 1
|
||||
+ t->loop = aeCreateEventLoop(10000);
|
||||
+#endif
|
||||
t->connections = cfg.connections / cfg.threads;
|
||||
|
||||
t->L = script_create(cfg.script, url, headers);
|
||||
@@ -122,12 +137,16 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
+#ifndef __WIN32__
|
||||
struct sigaction sa = {
|
||||
.sa_handler = handler,
|
||||
.sa_flags = 0,
|
||||
};
|
||||
sigfillset(&sa.sa_mask);
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
+#else
|
||||
+ signal(SIGINT, handler);
|
||||
+#endif
|
||||
|
||||
char *time = format_time_s(cfg.duration);
|
||||
printf("Running %s test @ %s\n", time, url);
|
||||
@@ -231,18 +250,34 @@ static int connect_socket(thread *thread, connection *c) {
|
||||
struct addrinfo *addr = thread->addr;
|
||||
struct aeEventLoop *loop = thread->loop;
|
||||
int fd, flags;
|
||||
+#ifdef __WIN32__
|
||||
+ unsigned long non_blocking;
|
||||
+#endif
|
||||
|
||||
fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
|
||||
|
||||
+#ifndef __WIN32__
|
||||
flags = fcntl(fd, F_GETFL, 0);
|
||||
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||
+#else
|
||||
+ non_blocking = 1;
|
||||
+ ioctlsocket(fd, FIONBIO, &non_blocking);
|
||||
+#endif
|
||||
|
||||
if (connect(fd, addr->ai_addr, addr->ai_addrlen) == -1) {
|
||||
+#ifndef __WIN32__
|
||||
if (errno != EINPROGRESS) goto error;
|
||||
+#else
|
||||
+ if (WSAGetLastError() != WSAEWOULDBLOCK) goto error;
|
||||
+#endif
|
||||
}
|
||||
|
||||
flags = 1;
|
||||
- setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flags, sizeof(flags));
|
||||
+ setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,
|
||||
+#ifdef __WIN32__
|
||||
+ (const char*)
|
||||
+#endif
|
||||
+ &flags, sizeof(flags));
|
||||
|
||||
flags = AE_READABLE | AE_WRITABLE;
|
||||
if (aeCreateFileEvent(loop, fd, flags, socket_connected, c) == AE_OK) {
|
||||
diff --git a/src/wrk.h b/src/wrk.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/wrk.h
|
||||
+++ b/src/wrk.h
|
||||
@@ -5,8 +5,14 @@
|
||||
#include <pthread.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/types.h>
|
||||
+
|
||||
+#ifndef __WIN32__
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
+#else
|
||||
+#include <winsock2.h>
|
||||
+#include <ws2tcpip.h> // addrinfo
|
||||
+#endif
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
@ -0,0 +1,33 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := wrk
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 4.0.1
|
||||
$(PKG)_CHECKSUM := c03bbc283836cb4b706eb6bfd18e724a8ce475e2c16154c13c6323a845b4327d
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://github.com/wg/wrk/archive/$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_WEBSITE := https://github.com/wg/wrk
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_DEPS := gcc luajit openssl pthreads
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, wg/wrk)
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
$(MAKE) \
|
||||
-C '$(1)' \
|
||||
-j '$(JOBS)' \
|
||||
CC='$(TARGET)-gcc' \
|
||||
TARGET='mingw' \
|
||||
LUAJIT='$(PREFIX)/$(BUILD)/bin/luajit' \
|
||||
LUA_PATH='$(PREFIX)/$(BUILD)/share/luajit-$(luajit_VERSION)/?.lua' \
|
||||
LUAJIT_A='$(PREFIX)/$(TARGET)/lib/libluajit-$(luajit_ABIVER).a' \
|
||||
LUAJIT_I='$(PREFIX)/$(TARGET)/include/luajit-$(call SHORT_PKG_VERSION,luajit)/' \
|
||||
EXTRA_LIBS='-lz -lws2_32 -lgdi32' \
|
||||
BIN='wrk.exe'
|
||||
cp '$(1)/wrk.exe' '$(PREFIX)/$(TARGET)/bin/'
|
||||
endef
|
||||
|
||||
$(PKG)_BUILD_SHARED =
|
@ -0,0 +1,84 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# MXE provides a fully featured build of Qt. Some users want more control...
|
||||
# https://lists.nongnu.org/archive/html/mingw-cross-env-list/2013-08/msg00010.html
|
||||
# https://lists.nongnu.org/archive/html/mingw-cross-env-list/2012-05/msg00019.html
|
||||
#
|
||||
# build of qt and deps is (say): 25 mins with 12.5 MB test program
|
||||
# custom with minimal deps is: 4 mins with 7.6 MB test program
|
||||
# custom min deps and cflags is: 4 mins with 5.9 MB test program
|
||||
#
|
||||
# make qt MXE_PLUGIN_DIRS='plugins/custom-qt-min'
|
||||
|
||||
$(info == Custom Qt overrides: $(lastword $(MAKEFILE_LIST)))
|
||||
|
||||
qt_DEPS := gcc
|
||||
|
||||
define qt_BUILD
|
||||
$(SED) -i 's,\(^QMAKE_CFLAGS_RELEASE\).*,\1 = -pipe -Os -fomit-frame-pointer -momit-leaf-frame-pointer -fdata-sections -ffunction-sections,g' '$(1)/mkspecs/win32-g++/qmake.conf'
|
||||
cd '$(1)' && QTDIR='$(1)' ./bin/syncqt
|
||||
cd '$(1)' && \
|
||||
./configure \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-fast \
|
||||
-xplatform win32-g++-4.6 \
|
||||
-device-option CROSS_COMPILE=$(TARGET)- \
|
||||
-device-option PKG_CONFIG='$(TARGET)-pkg-config' \
|
||||
-force-pkg-config \
|
||||
-release \
|
||||
-static \
|
||||
-prefix '$(PREFIX)/$(TARGET)/qt' \
|
||||
-prefix-install \
|
||||
-make libs \
|
||||
-nomake demos \
|
||||
-nomake docs \
|
||||
-nomake examples \
|
||||
-nomake tools \
|
||||
-nomake translations \
|
||||
-no-accessibility \
|
||||
-no-audio-backend \
|
||||
-no-dbus \
|
||||
-no-declarative \
|
||||
-no-exceptions \
|
||||
-no-gif \
|
||||
-no-glib \
|
||||
-no-gstreamer \
|
||||
-no-iconv \
|
||||
-no-libjpeg \
|
||||
-no-libmng \
|
||||
-no-libpng \
|
||||
-no-libtiff \
|
||||
-no-multimedia \
|
||||
-no-opengl \
|
||||
-no-openssl \
|
||||
-no-phonon \
|
||||
-no-phonon-backend \
|
||||
-no-qt3support \
|
||||
-no-reduce-exports \
|
||||
-no-rpath \
|
||||
-no-script \
|
||||
-no-scripttools \
|
||||
-no-sql-mysql \
|
||||
-no-sql-odbc \
|
||||
-no-sql-psql \
|
||||
-no-sql-sqlite \
|
||||
-no-sql-tds \
|
||||
-no-stl \
|
||||
-no-svg \
|
||||
-no-webkit \
|
||||
-no-xmlpatterns \
|
||||
-qt-zlib \
|
||||
-v
|
||||
|
||||
$(MAKE) -C '$(1)' -j '$(JOBS)'
|
||||
rm -rf '$(PREFIX)/$(TARGET)/qt'
|
||||
$(MAKE) -C '$(1)' -j 1 install
|
||||
ln -sf '$(PREFIX)/$(TARGET)/qt/bin/qmake' '$(PREFIX)/bin/$(TARGET)'-qmake-qt4
|
||||
|
||||
mkdir '$(1)/test-qt'
|
||||
cd '$(1)/test-qt' && '$(PREFIX)/$(TARGET)/qt/bin/qmake' '$(PWD)/src/$(PKG)-test.pro'
|
||||
$(MAKE) -C '$(1)/test-qt' -j '$(JOBS)'
|
||||
$(INSTALL) -m755 '$(1)/test-qt/release/test-qt.exe' '$(PREFIX)/$(TARGET)/bin/'
|
||||
|
||||
endef
|
@ -0,0 +1,89 @@
|
||||
Cross Compiling a Host Toolchain
|
||||
--------------------------------
|
||||
|
||||
This plugin demonstrates a minimal working toolchain built with MXE to
|
||||
execute on a Windows host.
|
||||
|
||||
#### GCC
|
||||
|
||||
```
|
||||
make gcc-host MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
|
||||
```
|
||||
|
||||
This will run the usual steps to build a cross-compiler, then build a
|
||||
second pass to cross-compile the basic toolchain (`binutils` and `gcc`).
|
||||
|
||||
Once complete, copy `usr/{target}` to an appropriate Windows machine
|
||||
and execute the `usr\{target}\bin\test-gcc-host.bat` batch file. This
|
||||
builds and runs the `libgomp` test as a sanity check. The cross and host
|
||||
built programs should be identical (after stripping), confirmed with the
|
||||
final step:
|
||||
|
||||
```
|
||||
>fc /b test-gcc-host.exe test-pthreads-libgomp.exe
|
||||
Comparing files test-gcc-host.exe and TEST-PTHREADS-LIBGOMP.EXE
|
||||
FC: no differences encountered
|
||||
```
|
||||
|
||||
#### CMake
|
||||
|
||||
```
|
||||
make cmake-host MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
|
||||
```
|
||||
|
||||
CMake defaults to Visual Studio generators and additional configuration is
|
||||
required for [MinGW or MSYS Makefiles][cmake-generators]. MinGW uses `cmd.exe`
|
||||
and requires `mingw32-make`, MSYS uses `make` and requires `/bin/sh`. The
|
||||
latter is recommended for further investigation since it's closest to the
|
||||
normal environment MXE expects. See the following projects for shells and
|
||||
terminal emulators:
|
||||
|
||||
- [MSYS2][msys2]
|
||||
- [Git for Windows][git-win] - uses MSYS2
|
||||
- [ConEmu][conemu] - usable terminal
|
||||
- [cmder][cmder] - bundles ConEmu and Git
|
||||
|
||||
#### Make
|
||||
|
||||
Make is difficult to cross-compile so it is downloaded from the [source
|
||||
recommended by the GNU Make team](https://git.savannah.gnu.org/cgit/make.git/tree/README.W32.template).
|
||||
|
||||
#### pkgconf/pkg-config
|
||||
|
||||
```
|
||||
make pkgconf-host MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
|
||||
```
|
||||
|
||||
This will cross-compile `pkgconf` and create the `pkg-config` wrapper. The
|
||||
wrapper requires `/bin/sh` so one of the [MSYS2][msys2] options should be used.
|
||||
Run the `usr/{target}/bin/test-pkgconf-host` script to build `libffi` test
|
||||
with non-standard include paths.
|
||||
|
||||
#### Qt5 tools (`qmake.exe`, `rcc.exe`, etc.)
|
||||
|
||||
```
|
||||
make qt5-host-tools MXE_PLUGIN_DIRS=plugins/examples/host-toolchain/
|
||||
```
|
||||
|
||||
This will build `qtbase`, cross-compile the toolchain and qt tools, and
|
||||
download `make` binaries.
|
||||
|
||||
On a windows machine, execute
|
||||
`usr\{target}\qt5\test-qt5-host-tools\test-qt5-host-tools.bat` to build and
|
||||
confirm the normal `qt` test with the cross-compiled `qtbase` libraries.
|
||||
|
||||
Why?
|
||||
----
|
||||
|
||||
Simply for curiosity, it's hard to see a practical use for this. Certainly,
|
||||
attempting to use it as a way to bootstrap MXE on Windows would strain
|
||||
one's sanity and cross-compiling is the recommended way (even if that means
|
||||
running a Linux VM on Windows).
|
||||
|
||||
|
||||
|
||||
[cmake-generators]:https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html
|
||||
[cmder]:http://cmder.net/
|
||||
[conemu]:https://conemu.github.io/
|
||||
[git-win]:https://git-for-windows.github.io/
|
||||
[msys2]:https://msys2.github.io/
|
@ -0,0 +1,37 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := binutils-host
|
||||
$(PKG)_IGNORE = $(binutils_IGNORE)
|
||||
$(PKG)_VERSION = $(binutils_VERSION)
|
||||
$(PKG)_CHECKSUM = $(binutils_CHECKSUM)
|
||||
$(PKG)_SUBDIR = $(binutils_SUBDIR)
|
||||
$(PKG)_FILE = $(binutils_FILE)
|
||||
$(PKG)_URL = $(binutils_URL)
|
||||
$(PKG)_URL_2 = $(binutils_URL_2)
|
||||
$(PKG)_DEPS := gcc
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
echo $(binutils_VERSION)
|
||||
endef
|
||||
|
||||
$(PKG)_PROGS := addr2line ar as c++filt dlltool dllwrap elfedit gprof \
|
||||
ld.bfd ld nm objcopy objdump ranlib readelf size strings \
|
||||
strip windmc windres
|
||||
|
||||
define $(PKG)_BUILD
|
||||
$(subst --disable-werror,\
|
||||
--disable-werror \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--program-prefix='$(TARGET)-' \
|
||||
--host='$(TARGET)',\
|
||||
$(binutils_BUILD))
|
||||
|
||||
# install unprefixed versions also
|
||||
for p in $($(PKG)_PROGS); do \
|
||||
cp "$(PREFIX)/$(TARGET)/bin/$(TARGET)-$$p.exe" \
|
||||
"$(PREFIX)/$(TARGET)/bin/$$p.exe" ; \
|
||||
done
|
||||
|
||||
# tools seem to be duplicates of '$(PREFIX)/$(TARGET)'
|
||||
rm -rf '$(PREFIX)/$(TARGET)/$(TARGET)'
|
||||
endef
|
@ -0,0 +1,21 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := cmake-host
|
||||
$(PKG)_IGNORE = $(cmake_IGNORE)
|
||||
$(PKG)_VERSION = $(cmake_VERSION)
|
||||
$(PKG)_CHECKSUM = $(cmake_CHECKSUM)
|
||||
$(PKG)_SUBDIR = $(cmake_SUBDIR)
|
||||
$(PKG)_FILE = $(cmake_FILE)
|
||||
$(PKG)_URL = $(cmake_URL)
|
||||
$(PKG)_URL_2 = $(cmake_URL_2)
|
||||
$(PKG)_DEPS := gcc
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
echo $(cmake_VERSION)
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(BUILD_DIR)' && $(TARGET)-cmake '$(SOURCE_DIR)'
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j $(JOBS) VERBOSE=1
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
|
||||
endef
|
@ -0,0 +1,65 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := gcc-host
|
||||
$(PKG)_IGNORE = $(gcc_IGNORE)
|
||||
$(PKG)_VERSION = $(gcc_VERSION)
|
||||
$(PKG)_CHECKSUM = $(gcc_CHECKSUM)
|
||||
$(PKG)_SUBDIR = $(gcc_SUBDIR)
|
||||
$(PKG)_FILE = $(gcc_FILE)
|
||||
$(PKG)_PATCHES = $(realpath $(sort $(wildcard $(addsuffix /gcc-[0-9]*.patch, $(TOP_DIR)/src))))
|
||||
$(PKG)_URL = $(gcc_URL)
|
||||
$(PKG)_URL_2 = $(gcc_URL_2)
|
||||
$(PKG)_DEPS := gcc binutils-host gmp isl mpfr mpc pthreads
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
echo $(gcc_VERSION)
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
|
||||
--host='$(TARGET)' \
|
||||
--target='$(TARGET)' \
|
||||
--build='$(BUILD)' \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--with-native-system-header-dir='$(PREFIX)/$(TARGET)/include' \
|
||||
--enable-languages='c,c++,objc,fortran' \
|
||||
--enable-version-specific-runtime-libs \
|
||||
--with-gcc \
|
||||
--with-gnu-ld \
|
||||
--with-gnu-as \
|
||||
--disable-nls \
|
||||
--without-libiconv-prefix \
|
||||
$(if $(BUILD_STATIC),--disable-shared) \
|
||||
--disable-multilib \
|
||||
--without-x \
|
||||
--disable-win32-registry \
|
||||
--enable-threads=$(MXE_GCC_THREADS) \
|
||||
--enable-libgomp \
|
||||
--with-{gmp,isl,mpc,mpfr}='$(PREFIX)/$(TARGET)' \
|
||||
$($(PKG)_CONFIGURE_OPTS)
|
||||
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
|
||||
|
||||
# shared libgcc isn't installed to version-specific locations
|
||||
# so install correctly to simplify cleanup (see gcc.mk)
|
||||
$(and $(BUILD_SHARED),
|
||||
$(MAKE) -C '$(BUILD_DIR)/$(TARGET)/libgcc' -j 1 \
|
||||
toolexecdir='$(PREFIX)/$(TARGET)/bin' \
|
||||
SHLIB_SLIBDIR_QUAL= \
|
||||
install-shared
|
||||
-rm -v '$(PREFIX)/$(TARGET)/lib/gcc/$(TARGET)/'libgcc_s*.dll
|
||||
-rm -v '$(PREFIX)/$(TARGET)/lib/gcc/$(TARGET)/lib/'libgcc_s*.a
|
||||
-rmdir '$(PREFIX)/$(TARGET)/lib/gcc/$(TARGET)/lib/')
|
||||
|
||||
# test compilation on host
|
||||
# strip and compare cross and host-built tests
|
||||
cp '$(TOP_DIR)/src/pthreads-libgomp-test.c' '$(PREFIX)/$(TARGET)/bin/test-$(PKG).c'
|
||||
(printf 'set PATH=..\\bin;%%PATH%%\r\n'; \
|
||||
printf 'gcc test-$(PKG).c -o test-$(PKG).exe -fopenmp -v\r\n'; \
|
||||
printf 'test-$(PKG).exe\r\n'; \
|
||||
printf 'strip test-$(PKG).exe test-pthreads-libgomp.exe\r\n'; \
|
||||
printf 'fc /b test-$(PKG).exe test-pthreads-libgomp.exe\r\n'; \
|
||||
printf 'cmd\r\n';) \
|
||||
> '$(PREFIX)/$(TARGET)/bin/test-$(PKG).bat'
|
||||
endef
|
@ -0,0 +1,21 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := make-w32-bin
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 4.2
|
||||
$(PKG)_CHECKSUM := 6cab11301e601996ab0cb7b3b903e5a55d5bd795614946cf6bd025cd61c710c6
|
||||
$(PKG)_SUBDIR := .
|
||||
$(PKG)_FILE := make-$($(PKG)_VERSION)-without-guile-w32-bin.zip
|
||||
$(PKG)_URL := https://$(SOURCEFORGE_MIRROR)/project/ezwinports/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS :=
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://sourceforge.net/projects/ezwinports/files/' | \
|
||||
$(SED) -n 's,.*/make-\([0-9.]*\)-without-guile.*,\1,p' | \
|
||||
head -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cp '$(1)/bin/'* '$(PREFIX)/$(TARGET)/bin/'
|
||||
cp '$(1)/lib/'* '$(PREFIX)/$(TARGET)/lib/'
|
||||
endef
|
@ -0,0 +1,46 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := pkgconf-host
|
||||
$(PKG)_IGNORE = $(pkgconf_IGNORE)
|
||||
$(PKG)_VERSION = $(pkgconf_VERSION)
|
||||
$(PKG)_CHECKSUM = $(pkgconf_CHECKSUM)
|
||||
$(PKG)_SUBDIR = $(pkgconf_SUBDIR)
|
||||
$(PKG)_FILE = $(pkgconf_FILE)
|
||||
$(PKG)_URL = $(pkgconf_URL)
|
||||
$(PKG)_URL_2 = $(pkgconf_URL_2)
|
||||
$(PKG)_DEPS := gcc libffi
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
echo $(pkgconf_VERSION)
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(SOURCE_DIR)' && ./autogen.sh
|
||||
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
|
||||
$(MXE_CONFIGURE_OPTS)
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
|
||||
|
||||
# create pkg-config script with relative paths
|
||||
(echo '#!/bin/sh'; \
|
||||
echo 'PKG_CONFIG_PATH="../qt5/lib/pkgconfig":"$$PKG_CONFIG_PATH_$(subst .,_,$(subst -,_,$(TARGET)))" \
|
||||
PKG_CONFIG_LIBDIR='\''../lib/pkgconfig'\'' \
|
||||
exec '../bin/pkgconf' \
|
||||
$(if $(BUILD_STATIC),--static) \
|
||||
--define-variable=prefix=.. \
|
||||
"$$@"' \
|
||||
) > '$(PREFIX)/$(TARGET)/bin/pkg-config'
|
||||
chmod 0755 '$(PREFIX)/$(TARGET)/bin/pkg-config'
|
||||
|
||||
# test compilation on host with libffi in non-std prefix
|
||||
cp '$(PWD)/src/libffi-test.c' '$(PREFIX)/$(TARGET)/bin/test-$(PKG).c'
|
||||
(echo '#!/bin/sh'; \
|
||||
echo 'export PATH=../bin:$PATH'; \
|
||||
echo 'gcc -v \
|
||||
-W -Wall -Werror -ansi -pedantic \
|
||||
test-$(PKG).c -o test-$(PKG).exe \
|
||||
`pkg-config --cflags --libs libffi`'; \
|
||||
echo 'test-$(PKG).exe'; \
|
||||
) > '$(PREFIX)/$(TARGET)/bin/test-$(PKG)'
|
||||
chmod 0755 '$(PREFIX)/$(TARGET)/bin/test-$(PKG)'
|
||||
endef
|
@ -0,0 +1,73 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := $(basename $(notdir $(lastword $(MAKEFILE_LIST))))
|
||||
$(PKG)_FILE = $(qtbase_FILE)
|
||||
$(PKG)_PATCHES = $(realpath $(sort $(wildcard $(addsuffix /qtbase-[0-9]*.patch, $(TOP_DIR)/src))))
|
||||
$(PKG)_SUBDIR = $(qtbase_SUBDIR)
|
||||
$(PKG)_DEPS := gcc gcc-host make-w32-bin qtbase winpthreads-host
|
||||
|
||||
# main configure options: -platform -host-option -external-hostbindir
|
||||
# further testing needed: -prefix -extprefix -hostprefix -sysroot -no-gcc-sysroot
|
||||
# and keeping options synced with qtbase
|
||||
|
||||
define $(PKG)_BUILD
|
||||
$(SED) -i 's,BUILD_ON_MAC=yes,BUILD_ON_MAC=no,g' '$(1)/configure'
|
||||
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
|
||||
-prefix '$(PREFIX)/$(TARGET)/qt5' \
|
||||
$(if $(BUILD_STATIC),-static,-shared) \
|
||||
-release \
|
||||
-c++std c++11 \
|
||||
-platform win32-g++ \
|
||||
-host-option CROSS_COMPILE=${TARGET}- \
|
||||
-external-hostbindir '$(PREFIX)/$(TARGET)/qt5/bin' \
|
||||
-device-option PKG_CONFIG='$(TARGET)-pkg-config' \
|
||||
-device-option CROSS_COMPILE=$(TARGET)- \
|
||||
-force-pkg-config \
|
||||
-no-icu \
|
||||
-no-sql-{db2,ibase,mysql,oci,odbc,psql,sqlite,sqlite2,tds} \
|
||||
-no-use-gold-linker \
|
||||
-nomake examples \
|
||||
-nomake tests \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-continue \
|
||||
-verbose
|
||||
|
||||
# generate remaining build configuration (qmake is created by configure)
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j $(JOBS) \
|
||||
sub-src-qmake_all
|
||||
|
||||
# build other tools
|
||||
$(MAKE) -C '$(BUILD_DIR)/src' -j $(JOBS) \
|
||||
sub-{moc,qdbuscpp2xml,qdbusxml2cpp,qlalr,rcc,uic}-all
|
||||
|
||||
# install tools and create `qt.conf` for runtime config
|
||||
cp '$(BUILD_DIR)/bin'/*.exe '$(PREFIX)/$(TARGET)/qt5/bin/'
|
||||
(printf '[Paths]\r\n'; \
|
||||
printf 'Prefix = ..\r\n'; \
|
||||
) > '$(PREFIX)/$(TARGET)/qt5/bin/qt.conf'
|
||||
|
||||
# test compilation on host
|
||||
# windows can't work with symlinks
|
||||
$(and $(BUILD_STATIC),
|
||||
rm -f '$(PREFIX)/$(TARGET)/lib/libpng.a' && \
|
||||
cp '$(PREFIX)/$(TARGET)/lib/libpng16.a' '$(PREFIX)/$(TARGET)/lib/libpng.a';
|
||||
rm -f '$(PREFIX)/$(TARGET)/lib/libharfbuzz_too.a' && \
|
||||
cp '$(PREFIX)/$(TARGET)/lib/libharfbuzz.a' '$(PREFIX)/$(TARGET)/lib/libharfbuzz_too.a';
|
||||
)
|
||||
|
||||
# copy required test files and create batch file
|
||||
mkdir -p '$(PREFIX)/$(TARGET)/qt5/test-$(PKG)'
|
||||
cp '$(PWD)/src/qt-test.'* '$(PREFIX)/$(TARGET)/qt5/test-$(PKG)/'
|
||||
cp '$(PWD)/src/qt.mk' '$(PREFIX)/$(TARGET)/qt5/test-$(PKG)/'
|
||||
(printf 'set PWD=%%~dp0\r\n'; \
|
||||
printf 'set PATH=%%PWD%%..\\bin;%%PWD%%..\\..\\bin;%%PWD%%..\\lib;%%PWD%%..\\..\\lib;%%PATH%%\r\n'; \
|
||||
printf 'set QT_QPA_PLATFORM_PLUGIN_PATH=%%PWD%%..\\plugins\r\n'; \
|
||||
printf 'mkdir build\r\n'; \
|
||||
printf 'cd build\r\n'; \
|
||||
printf 'qmake ..\r\n'; \
|
||||
printf 'make -j $(JOBS)\r\n'; \
|
||||
printf '%%PWD%%\\build\\release\\test-qt5.exe\r\n'; \
|
||||
printf 'cmd\r\n'; \
|
||||
) > '$(PREFIX)/$(TARGET)/qt5/test-$(PKG)/test-$(PKG).bat'
|
||||
endef
|
@ -0,0 +1,25 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := winpthreads-host
|
||||
$(PKG)_IGNORE = $(mingw-w64_IGNORE)
|
||||
$(PKG)_VERSION = $(mingw-w64_VERSION)
|
||||
$(PKG)_CHECKSUM = $(mingw-w64_CHECKSUM)
|
||||
$(PKG)_SUBDIR = $(mingw-w64_SUBDIR)
|
||||
$(PKG)_FILE = $(mingw-w64_FILE)
|
||||
$(PKG)_URL = $(mingw-w64_URL)
|
||||
$(PKG)_URL_2 = $(mingw-w64_URL_2)
|
||||
$(PKG)_DEPS := gcc
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
echo $(mingw-w64_VERSION)
|
||||
endef
|
||||
|
||||
# temporary build until gcc is built only once per arch
|
||||
define $(PKG)_BUILD
|
||||
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/mingw-w64-libraries/winpthreads/configure' \
|
||||
$(MXE_CONFIGURE_OPTS) \
|
||||
--enable-static \
|
||||
--enable-shared
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(BUILD_DIR)' -j 1 install
|
||||
endef
|
@ -0,0 +1,4 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
poppler_DEPS := $(filter-out qt ,$(poppler_DEPS)) qtbase
|
||||
openscenegraph_DEPS := $(filter-out qt ,$(openscenegraph_DEPS)) qtbase
|
@ -0,0 +1,4 @@
|
||||
# Notes about GCC version 4.9.4
|
||||
|
||||
GCC 4.9.4 was used before [GCC 5.4.0](https://github.com/mxe/mxe/pull/1541).
|
||||
This plugin is a backup in case of problems with GCC 5.4.0.
|
@ -0,0 +1,22 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# This plugin is needed in case of issues with GCC 5.4.0:
|
||||
# https://github.com/mxe/mxe/pull/1541#issuecomment-274035553
|
||||
|
||||
PKG := cloog
|
||||
$(PKG)_VERSION := 0.18.1
|
||||
$(PKG)_CHECKSUM := 02500a4edd14875f94fe84cbeda4290425cb0c1c2474c6f75d75a303d64b4196
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://www.bastoul.net/cloog/pages/download/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := ftp://gcc.gnu.org/pub/gcc/infrastructure/$($(PKG)_FILE)
|
||||
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
|
||||
$(PKG)_DEPS_$(BUILD) := gmp isl
|
||||
|
||||
PKG := isl
|
||||
$(PKG)_VERSION := 0.12.2
|
||||
$(PKG)_CHECKSUM := f4b3dbee9712850006e44f0db2103441ab3d13b406f77996d1df19ee89d11fb4
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
|
||||
$(PKG)_URL := http://isl.gforge.inria.fr/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := ftp://gcc.gnu.org/pub/gcc/infrastructure/$($(PKG)_FILE)
|
@ -0,0 +1,130 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := gcc
|
||||
$(PKG)_WEBSITE := https://gcc.gnu.org/
|
||||
$(PKG)_DESCR := GCC
|
||||
$(PKG)_IGNORE := 5%
|
||||
$(PKG)_VERSION := 4.9.4
|
||||
$(PKG)_CHECKSUM := 6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092
|
||||
$(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
|
||||
$(PKG)_PATCHES := $(basename $(lastword $(MAKEFILE_LIST))).patch
|
||||
$(PKG)_URL := https://ftp.gnu.org/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := https://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS := binutils mingw-w64
|
||||
|
||||
$(PKG)_FILE_$(BUILD) :=
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \
|
||||
$(SED) -n 's,.*<a href="gcc-\([0-9][^"]*\)/".*,\1,p' | \
|
||||
$(SORT) -V | \
|
||||
tail -1
|
||||
endef
|
||||
|
||||
define $(PKG)_CONFIGURE
|
||||
# configure gcc
|
||||
mkdir '$(1).build'
|
||||
cd '$(1).build' && '$(1)/configure' \
|
||||
--target='$(TARGET)' \
|
||||
--build='$(BUILD)' \
|
||||
--prefix='$(PREFIX)' \
|
||||
--libdir='$(PREFIX)/lib' \
|
||||
--enable-languages='c,c++,objc,fortran' \
|
||||
--enable-version-specific-runtime-libs \
|
||||
--with-gcc \
|
||||
--with-gnu-ld \
|
||||
--with-gnu-as \
|
||||
--disable-nls \
|
||||
$(if $(BUILD_STATIC),--disable-shared) \
|
||||
--disable-multilib \
|
||||
--without-x \
|
||||
--disable-win32-registry \
|
||||
--enable-threads=$(MXE_GCC_THREADS) \
|
||||
--enable-libgomp \
|
||||
--with-gmp='$(PREFIX)/$(BUILD)' \
|
||||
--with-isl='$(PREFIX)/$(BUILD)' \
|
||||
--with-mpc='$(PREFIX)/$(BUILD)' \
|
||||
--with-mpfr='$(PREFIX)/$(BUILD)' \
|
||||
--with-cloog='$(PREFIX)/$(BUILD)' \
|
||||
--with-as='$(PREFIX)/bin/$(TARGET)-as' \
|
||||
--with-ld='$(PREFIX)/bin/$(TARGET)-ld' \
|
||||
--with-nm='$(PREFIX)/bin/$(TARGET)-nm' \
|
||||
$(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'")
|
||||
endef
|
||||
|
||||
define $(PKG)_POST_BUILD
|
||||
# - no non-trivial way to configure installation of *.dlls
|
||||
# each sudbir has it's own variations of variables like:
|
||||
# `toolexeclibdir` `install-toolexeclibLTLIBRARIES` etc.
|
||||
# and maintaining those would be cumbersome
|
||||
# - need to keep `--enable-version-specific-runtime-libs` otherwise
|
||||
# libraries go directly into $(PREFIX)/$(TARGET)/lib and are
|
||||
# harder to cleanup
|
||||
# - ignore rm failure as parallel build may have cleaned up, but
|
||||
# don't wildcard all libs so future additions will be detected
|
||||
$(and $(BUILD_SHARED),
|
||||
mv -v '$(PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/'*.dll '$(PREFIX)/$(TARGET)/bin/'
|
||||
-rm -v '$(PREFIX)/lib/gcc/$(TARGET)/'libgcc_s*.dll
|
||||
-rm -v '$(PREFIX)/lib/gcc/$(TARGET)/lib/'libgcc_s*.a
|
||||
-rmdir '$(PREFIX)/lib/gcc/$(TARGET)/lib/')
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD_mingw-w64
|
||||
# install mingw-w64 headers
|
||||
$(call PREPARE_PKG_SOURCE,mingw-w64,$(1))
|
||||
mkdir '$(1).headers-build'
|
||||
cd '$(1).headers-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-headers/configure' \
|
||||
--host='$(TARGET)' \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--enable-sdk=all \
|
||||
--enable-idl \
|
||||
--enable-secure-api \
|
||||
$(mingw-w64-headers_CONFIGURE_OPTS)
|
||||
$(MAKE) -C '$(1).headers-build' install
|
||||
|
||||
# build standalone gcc
|
||||
$($(PKG)_CONFIGURE)
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)' all-gcc
|
||||
$(MAKE) -C '$(1).build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)-gcc
|
||||
|
||||
# build mingw-w64-crt
|
||||
mkdir '$(1).crt-build'
|
||||
cd '$(1).crt-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-crt/configure' \
|
||||
--host='$(TARGET)' \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
@gcc-crt-config-opts@
|
||||
$(MAKE) -C '$(1).crt-build' -j '$(JOBS)' || $(MAKE) -C '$(1).crt-build' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(1).crt-build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
|
||||
|
||||
# build posix threads
|
||||
mkdir '$(1).pthread-build'
|
||||
cd '$(1).pthread-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-libraries/winpthreads/configure' \
|
||||
$(MXE_CONFIGURE_OPTS)
|
||||
$(MAKE) -C '$(1).pthread-build' -j '$(JOBS)' || $(MAKE) -C '$(1).pthread-build' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(1).pthread-build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
|
||||
|
||||
# build rest of gcc
|
||||
cd '$(1).build'
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(1).build' -j 1 $(INSTALL_STRIP_TOOLCHAIN)
|
||||
|
||||
# shared libgcc isn't installed to version-specific locations
|
||||
# so install correctly to simplify cleanup
|
||||
$(and $(BUILD_SHARED),
|
||||
$(MAKE) -C '$(1).build/$(TARGET)/libgcc' -j 1 \
|
||||
toolexecdir='$(PREFIX)/$(TARGET)/bin' \
|
||||
SHLIB_SLIBDIR_QUAL= \
|
||||
install-shared)
|
||||
|
||||
$($(PKG)_POST_BUILD)
|
||||
endef
|
||||
|
||||
$(PKG)_BUILD_x86_64-w64-mingw32 = $(subst @gcc-crt-config-opts@,--disable-lib32,$($(PKG)_BUILD_mingw-w64))
|
||||
$(PKG)_BUILD_i686-w64-mingw32 = $(subst @gcc-crt-config-opts@,--disable-lib64,$($(PKG)_BUILD_mingw-w64))
|
||||
|
||||
define $(PKG)_BUILD_$(BUILD)
|
||||
for f in c++ cpp g++ gcc gcov; do \
|
||||
ln -sf "`which $$f`" '$(PREFIX)/bin/$(TARGET)'-$$f ; \
|
||||
done
|
||||
endef
|
@ -0,0 +1,70 @@
|
||||
# Notes about GCC version 6.1.0 and later
|
||||
|
||||
GCC 6.1 is released with a number of major changes
|
||||
[[1](https://gcc.gnu.org/ml/gcc-announce/2016/msg00000.html)]
|
||||
[[2](https://gcc.gnu.org/gcc-6/changes.html)]
|
||||
. The most notable change is:
|
||||
> The `C++` frontend now defaults to `C++14` standard instead of `C++98` it has
|
||||
> been defaulting to previously, for compiling older `C++` code that might
|
||||
> require either explicitly compiling with selected older `C++` standards,
|
||||
> or might require some code adjustment, see
|
||||
> [[3](https://gcc.gnu.org/gcc-6/porting_to.html)]
|
||||
> for details.
|
||||
|
||||
So it is expected that some of MXE packages will fails to build from source
|
||||
(FTBFS) with default GCC 6.x options. As a workaround we may add `-std=gnu++11`
|
||||
or `-std=gnu++98` into `CXXFLAGS` for building problematic packages. And this
|
||||
will not affect the builds with older versions of GCC.
|
||||
|
||||
For example, in autotools based projects:
|
||||
```
|
||||
...
|
||||
$(PKG)_CXXFLAGS := -std=gnu++11
|
||||
...
|
||||
cd '$(1)' && \
|
||||
CXXFLAGS="$($(PKG)_CXXFLAGS)" \
|
||||
./configure \
|
||||
...
|
||||
```
|
||||
|
||||
Just after adding this plugin (gcc6) some packages were FTBFS. For now, these
|
||||
packages might be already fixed by upstream developers, by additional patches
|
||||
or using above mentioned workaround. See the table below for details. If some
|
||||
MXE packages or your personal projects are still FTBFS you may look how other
|
||||
packages were fixed and use similar approach.
|
||||
|
||||
Please ensure that proposed fixes for packages also build with earlier GCC
|
||||
versions [[4](https://github.com/mxe/mxe/commit/a1cc019)].
|
||||
|
||||
| package | target | fixed in commit |
|
||||
| ------------------ | --------------------------------------- | ---------------------------------------------------- |
|
||||
| boost | all | [7ca2bce](https://github.com/mxe/mxe/commit/7ca2bce) |
|
||||
| cgal | all | - |
|
||||
| dcmtk | static (all) | [8608e13](https://github.com/mxe/mxe/commit/8608e13) |
|
||||
| fdk-aac | all | [363aec7](https://github.com/mxe/mxe/commit/363aec7) |
|
||||
| flann | all | [73cd813](https://github.com/mxe/mxe/commit/73cd813) |
|
||||
| freeimage | static (all) | [adc74c9](https://github.com/mxe/mxe/commit/adc74c9) |
|
||||
| glib | all | [58c2c96](https://github.com/mxe/mxe/commit/58c2c96) |
|
||||
| gtkimageview | static (all) | - |
|
||||
| gtkmm2 | static (all) | - |
|
||||
| gtkmm3 | static (all) | - |
|
||||
| guile | i686-w64-mingw32.static (all) | - |
|
||||
| itk | all | [55e9bba](https://github.com/mxe/mxe/commit/55e9bba) |
|
||||
| jsoncpp | all | [0bc73f7](https://github.com/mxe/mxe/commit/0bc73f7) |
|
||||
| json_spirit | all | - |
|
||||
| librsvg | all | - |
|
||||
| libxml++ | all | - |
|
||||
| log4cxx | static (all) | - |
|
||||
| ocaml-lablgtk2 | i686-w64-mingw32.static (all) | - |
|
||||
| opencv | all | - |
|
||||
| ossim | all | - |
|
||||
| qt | all | [5aac1c3](https://github.com/mxe/mxe/commit/5aac1c3) |
|
||||
| qt3d | all | [d52961f](https://github.com/mxe/mxe/commit/d52961f) |
|
||||
| qtwebkit | i686-w64-mingw32.shared | - |
|
||||
| sdl_sound | static (all) | - |
|
||||
| smpeg | all | [57cb6bb](https://github.com/mxe/mxe/commit/57cb6bb) |
|
||||
| smpeg2 | all | [1a42cbc](https://github.com/mxe/mxe/commit/1a42cbc) |
|
||||
| ucl | all | [0ac2a77](https://github.com/mxe/mxe/commit/0ac2a77) |
|
||||
| vtk | static (all) | - |
|
||||
| vtk6 | all | - |
|
||||
| wxwidgets | static (all) | [6869e3b](https://github.com/mxe/mxe/commit/6869e3b) |
|
@ -0,0 +1,24 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# override relevant cloog, isl, and gcc variables changed in:
|
||||
# https://github.com/mxe/mxe/pull/965
|
||||
#
|
||||
# simply expanded variables (*_SUBDIR, *_FILE, etc.) need to be set
|
||||
|
||||
PKG := cloog
|
||||
$(PKG)_TARGETS := $(MXE_TARGETS)
|
||||
|
||||
PKG := isl
|
||||
$(PKG)_VERSION := 0.16.1
|
||||
$(PKG)_CHECKSUM := 412538bb65c799ac98e17e8cfcdacbb257a57362acfaaff254b0fcae970126d2
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
|
||||
$(PKG)_URL := http://isl.gforge.inria.fr/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := ftp://gcc.gnu.org/pub/gcc/infrastructure/$($(PKG)_FILE)
|
||||
|
||||
PKG := gcc
|
||||
$(PKG)_VERSION := 6.3.0
|
||||
$(PKG)_CHECKSUM := f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f
|
||||
$(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
|
||||
$(PKG)_URL := https://ftp.gnu.org/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
|
@ -0,0 +1,24 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# override relevant cloog, isl, and gcc variables changed in:
|
||||
# https://github.com/mxe/mxe/pull/965
|
||||
#
|
||||
# simply expanded variables (*_SUBDIR, *_FILE, etc.) need to be set
|
||||
|
||||
PKG := cloog
|
||||
$(PKG)_TARGETS := $(MXE_TARGETS)
|
||||
|
||||
PKG := isl
|
||||
$(PKG)_VERSION := 0.16.1
|
||||
$(PKG)_CHECKSUM := 412538bb65c799ac98e17e8cfcdacbb257a57362acfaaff254b0fcae970126d2
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
|
||||
$(PKG)_URL := http://isl.gforge.inria.fr/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := ftp://gcc.gnu.org/pub/gcc/infrastructure/$($(PKG)_FILE)
|
||||
|
||||
PKG := gcc
|
||||
$(PKG)_VERSION := 7.1.0
|
||||
$(PKG)_CHECKSUM := 8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17
|
||||
$(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
|
||||
$(PKG)_URL := https://ftp.gnu.org/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
|
@ -0,0 +1,34 @@
|
||||
# Go plugin for MXE
|
||||
|
||||
See also article [cross-compile go code, including cgo][1]
|
||||
by Dimitri John Ledkov.
|
||||
|
||||
[1]: http://blog.surgut.co.uk/2014/06/cross-compile-go-code-including-cgo.html
|
||||
|
||||
Package `go-native` installs native Go 1.4. This version of Go
|
||||
doesn't depend on Go installation.
|
||||
|
||||
Package `go` uses native Go 1.4 as a bootstrap and installs Go 1.6
|
||||
as a cross-compiler to windows/386 or windows/amd64. Versions of
|
||||
Go starting with 1.5 need Go installation to build.
|
||||
|
||||
To build Go packages for windows/386 or windows/amd64, you have to set
|
||||
the [GOPATH](https://golang.org/doc/code.html#GOPATH) environment variable
|
||||
and call `usr/bin/$(TARGET)-go` wrapper script.
|
||||
|
||||
## Example
|
||||
|
||||
Building [gohs](https://github.com/flier/gohs), GoLang Binding of
|
||||
[HyperScan](https://01.org/hyperscan).
|
||||
|
||||
```
|
||||
$ make hyperscan go MXE_PLUGIN_DIRS=plugins/go
|
||||
$ mkdir gopath
|
||||
$ GOPATH=`pwd`/gopath ./usr/bin/i686-w64-mingw32.static-go get \
|
||||
github.com/flier/gohs/examples/simplegrep
|
||||
$ ./gopath/bin/windows_386/simplegrep.exe root /etc/passwd
|
||||
Scanning 42 bytes with Hyperscan
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
root:x:0:0:root:/root:/bin/bash
|
||||
```
|
@ -0,0 +1,171 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Thu, 17 Nov 2016 00:22:19 +0100
|
||||
Subject: [PATCH] cmd/link: support new 386/amd64 relocations
|
||||
|
||||
It is needed to fix build on Debian 8 Stretch.
|
||||
See https://github.com/golang/go/issues/13896
|
||||
|
||||
Backport https://github.com/golang/go/commit/914db9f060b1fd3eb1f74d48f3bd46a73d4ae9c7
|
||||
|
||||
diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/cmd/6l/asm.c
|
||||
+++ b/src/cmd/6l/asm.c
|
||||
@@ -117,6 +117,8 @@ adddynrel(LSym *s, Reloc *r)
|
||||
}
|
||||
return;
|
||||
|
||||
+ case 256 + R_X86_64_REX_GOTPCRELX:
|
||||
+ case 256 + R_X86_64_GOTPCRELX:
|
||||
case 256 + R_X86_64_GOTPCREL:
|
||||
if(targ->type != SDYNIMPORT) {
|
||||
// have symbol
|
||||
diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/cmd/8l/asm.c
|
||||
+++ b/src/cmd/8l/asm.c
|
||||
@@ -115,6 +115,7 @@ adddynrel(LSym *s, Reloc *r)
|
||||
return;
|
||||
|
||||
case 256 + R_386_GOT32:
|
||||
+ case 256 + R_386_GOT32X:
|
||||
if(targ->type != SDYNIMPORT) {
|
||||
// have symbol
|
||||
if(r->off >= 2 && s->p[r->off-2] == 0x8b) {
|
||||
diff --git a/src/cmd/ld/elf.h b/src/cmd/ld/elf.h
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/cmd/ld/elf.h
|
||||
+++ b/src/cmd/ld/elf.h
|
||||
@@ -502,8 +502,23 @@ typedef struct {
|
||||
#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
|
||||
#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */
|
||||
#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */
|
||||
-
|
||||
-#define R_X86_64_COUNT 24 /* Count of defined relocation types. */
|
||||
+#define R_X86_64_PC64 24
|
||||
+#define R_X86_64_GOTOFF64 25
|
||||
+#define R_X86_64_GOTPC32 26
|
||||
+#define R_X86_64_GOT64 27
|
||||
+#define R_X86_64_GOTPCREL64 28
|
||||
+#define R_X86_64_GOTPC64 29
|
||||
+#define R_X86_64_GOTPLT64 30
|
||||
+#define R_X86_64_PLTOFF64 31
|
||||
+#define R_X86_64_SIZE32 32
|
||||
+#define R_X86_64_SIZE64 33
|
||||
+#define R_X86_64_GOTPC32_TLSDEC 34
|
||||
+#define R_X86_64_TLSDESC_CALL 35
|
||||
+#define R_X86_64_TLSDESC 36
|
||||
+#define R_X86_64_IRELATIVE 37
|
||||
+#define R_X86_64_PC32_BND 40
|
||||
+#define R_X86_64_GOTPCRELX 41
|
||||
+#define R_X86_64_REX_GOTPCRELX 42
|
||||
|
||||
|
||||
#define R_ALPHA_NONE 0 /* No reloc */
|
||||
@@ -535,8 +550,6 @@ typedef struct {
|
||||
#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
|
||||
#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
|
||||
|
||||
-#define R_ALPHA_COUNT 28
|
||||
-
|
||||
|
||||
#define R_ARM_NONE 0 /* No relocation. */
|
||||
#define R_ARM_PC24 1
|
||||
@@ -578,8 +591,6 @@ typedef struct {
|
||||
#define R_ARM_RPC24 254
|
||||
#define R_ARM_RBASE 255
|
||||
|
||||
-#define R_ARM_COUNT 38 /* Count of defined relocation types. */
|
||||
-
|
||||
|
||||
#define R_386_NONE 0 /* No relocation. */
|
||||
#define R_386_32 1 /* Add symbol value. */
|
||||
@@ -612,8 +623,42 @@ typedef struct {
|
||||
#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */
|
||||
#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */
|
||||
#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */
|
||||
-
|
||||
-#define R_386_COUNT 38 /* Count of defined relocation types. */
|
||||
+#define R_386_NONE 0
|
||||
+#define R_386_32 1
|
||||
+#define R_386_PC32 2
|
||||
+#define R_386_GOT32 3
|
||||
+#define R_386_PLT32 4
|
||||
+#define R_386_COPY 5
|
||||
+#define R_386_GLOB_DAT 6
|
||||
+#define R_386_JMP_SLOT 7
|
||||
+#define R_386_RELATIVE 8
|
||||
+#define R_386_GOTOFF 9
|
||||
+#define R_386_GOTPC 10
|
||||
+#define R_386_TLS_TPOFF 14
|
||||
+#define R_386_TLS_IE 15
|
||||
+#define R_386_TLS_GOTIE 16
|
||||
+#define R_386_TLS_LE 17
|
||||
+#define R_386_TLS_GD 18
|
||||
+#define R_386_TLS_LDM 19
|
||||
+#define R_386_TLS_GD_32 24
|
||||
+#define R_386_TLS_GD_PUSH 25
|
||||
+#define R_386_TLS_GD_CALL 26
|
||||
+#define R_386_TLS_GD_POP 27
|
||||
+#define R_386_TLS_LDM_32 28
|
||||
+#define R_386_TLS_LDM_PUSH 29
|
||||
+#define R_386_TLS_LDM_CALL 30
|
||||
+#define R_386_TLS_LDM_POP 31
|
||||
+#define R_386_TLS_LDO_32 32
|
||||
+#define R_386_TLS_IE_32 33
|
||||
+#define R_386_TLS_LE_32 34
|
||||
+#define R_386_TLS_DTPMOD32 35
|
||||
+#define R_386_TLS_DTPOFF32 36
|
||||
+#define R_386_TLS_TPOFF32 37
|
||||
+#define R_386_TLS_GOTDESC 39
|
||||
+#define R_386_TLS_DESC_CALL 40
|
||||
+#define R_386_TLS_DESC 41
|
||||
+#define R_386_IRELATIVE 42
|
||||
+#define R_386_GOT32X 43
|
||||
|
||||
#define R_PPC_NONE 0 /* No relocation. */
|
||||
#define R_PPC_ADDR32 1
|
||||
@@ -653,8 +698,6 @@ typedef struct {
|
||||
#define R_PPC_SECTOFF_HI 35
|
||||
#define R_PPC_SECTOFF_HA 36
|
||||
|
||||
-#define R_PPC_COUNT 37 /* Count of defined relocation types. */
|
||||
-
|
||||
#define R_PPC_TLS 67
|
||||
#define R_PPC_DTPMOD32 68
|
||||
#define R_PPC_TPREL16 69
|
||||
@@ -697,9 +740,6 @@ typedef struct {
|
||||
#define R_PPC_EMB_BIT_FLD 115
|
||||
#define R_PPC_EMB_RELSDA 116
|
||||
|
||||
- /* Count of defined relocation types. */
|
||||
-#define R_PPC_EMB_COUNT (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1)
|
||||
-
|
||||
|
||||
#define R_SPARC_NONE 0
|
||||
#define R_SPARC_8 1
|
||||
diff --git a/src/cmd/ld/ldelf.c b/src/cmd/ld/ldelf.c
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/cmd/ld/ldelf.c
|
||||
+++ b/src/cmd/ld/ldelf.c
|
||||
@@ -888,12 +888,15 @@ reltype(char *pn, int elftype, uchar *siz)
|
||||
case R('6', R_X86_64_PC32):
|
||||
case R('6', R_X86_64_PLT32):
|
||||
case R('6', R_X86_64_GOTPCREL):
|
||||
+ case R('6', R_X86_64_GOTPCRELX):
|
||||
+ case R('6', R_X86_64_REX_GOTPCRELX):
|
||||
case R('8', R_386_32):
|
||||
case R('8', R_386_PC32):
|
||||
case R('8', R_386_GOT32):
|
||||
case R('8', R_386_PLT32):
|
||||
case R('8', R_386_GOTOFF):
|
||||
case R('8', R_386_GOTPC):
|
||||
+ case R('8', R_386_GOT32X):
|
||||
*siz = 4;
|
||||
break;
|
||||
case R('6', R_X86_64_64):
|
@ -0,0 +1,31 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := go-native
|
||||
$(PKG)_WEBSITE := https://golang.org/
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.4.3
|
||||
$(PKG)_CHECKSUM := 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
|
||||
$(PKG)_SUBDIR := go
|
||||
$(PKG)_FILE := go$($(PKG)_VERSION).src.tar.gz
|
||||
$(PKG)_URL := https://storage.googleapis.com/golang/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS_$(BUILD) :=
|
||||
$(PKG)_TARGETS := $(BUILD)
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://golang.org/dl/' | \
|
||||
$(SED) -n 's,.*go\(1.4.[0-9][^>]*\)\.src\.tar.*,\1,p' | \
|
||||
$(SORT) -h | tail -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(1)/src' && \
|
||||
GOROOT_FINAL='$(PREFIX)/$(TARGET)/go' \
|
||||
DYLD_INSERT_LIBRARIES= \
|
||||
./make.bash
|
||||
|
||||
mkdir -p '$(PREFIX)/$(TARGET)/go'
|
||||
for d in include src bin pkg; do \
|
||||
cp -a '$(1)'/$$d '$(PREFIX)/$(TARGET)/go/' ; \
|
||||
done
|
||||
endef
|
@ -0,0 +1,61 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := go
|
||||
$(PKG)_WEBSITE := https://golang.org/
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.8
|
||||
$(PKG)_CHECKSUM := 406865f587b44be7092f206d73fc1de252600b79b3cacc587b74b5ef5c623596
|
||||
$(PKG)_SUBDIR := go
|
||||
$(PKG)_FILE := go$($(PKG)_VERSION).src.tar.gz
|
||||
$(PKG)_URL := https://storage.googleapis.com/golang/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS :=
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://golang.org/dl/' | \
|
||||
$(SED) -n 's,.*go\(1.[0-9][^>]*\)\.src\.tar.*,\1,p' | \
|
||||
$(SORT) -h | tail -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD
|
||||
cd '$(1)/src' && \
|
||||
GOROOT_BOOTSTRAP='$(PREFIX)/$(BUILD)/go' \
|
||||
GOROOT_FINAL='$(PREFIX)/$(TARGET)/go' \
|
||||
GOOS=windows \
|
||||
GOARCH='$(if $(findstring x86_64,$(TARGET)),amd64,386)' \
|
||||
DYLD_INSERT_LIBRARIES= \
|
||||
./make.bash
|
||||
|
||||
rm -rf '$(PREFIX)/$(TARGET)/go'
|
||||
mkdir -p '$(PREFIX)/$(TARGET)/go'
|
||||
for d in include src bin pkg; do \
|
||||
cp -a '$(1)'/$$d '$(PREFIX)/$(TARGET)/go/' ; \
|
||||
done
|
||||
|
||||
#create prefixed go wrapper script
|
||||
mkdir -p '$(PREFIX)/bin/$(TARGET)'
|
||||
(echo '#!/usr/bin/env bash'; \
|
||||
echo 'echo "== Using MXE Go wrapper: $(PREFIX)/bin/$(TARGET)-go"'; \
|
||||
echo 'set -xue'; \
|
||||
echo 'CGO_ENABLED=1 \'; \
|
||||
echo 'GOOS=windows \'; \
|
||||
echo 'GOARCH=$(if $(findstring x86_64,$(TARGET)),amd64,386) \'; \
|
||||
echo 'DYLD_INSERT_LIBRARIES= \'; \
|
||||
echo 'CC=$(PREFIX)/bin/$(TARGET)-gcc \'; \
|
||||
echo 'CXX=$(PREFIX)/bin/$(TARGET)-g++ \'; \
|
||||
echo 'PKG_CONFIG=$(PREFIX)/bin/$(TARGET)-pkg-config \'; \
|
||||
echo 'exec $(PREFIX)/$(TARGET)/go/bin/go \'; \
|
||||
echo '"$$@"'; \
|
||||
) \
|
||||
> '$(PREFIX)/bin/$(TARGET)-go'
|
||||
chmod 0755 '$(PREFIX)/bin/$(TARGET)-go'
|
||||
|
||||
GOPATH=$(PWD)/plugins/go \
|
||||
'$(TARGET)-go' build \
|
||||
-o '$(PREFIX)/$(TARGET)/go/bin/test-go.exe' \
|
||||
mxe-test
|
||||
endef
|
||||
|
||||
# -buildmode=shared not supported on windows
|
||||
# See https://golang.org/s/execmodes
|
||||
$(PKG)_BUILD_SHARED =
|
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Printf("hello, world\n")
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
LuaRocks plugin
|
||||
===============
|
||||
|
||||
Short description of LuaRocks
|
||||
-----------------------------
|
||||
|
||||
Hundreds of [Lua][lua] packages are distributed via [LuaRocks][luarocks].
|
||||
LuaRocks is the package manager for Lua. It allows you to create and
|
||||
install Luamodules as self-contained packages called rocks. You can
|
||||
download and install LuaRocks on Unix and Windows.
|
||||
|
||||
Lua rocks are similar to Ruby gems, Python eggs or JavaScript NPM. Command
|
||||
`luarocks install <rock>` downloads a rock from [luarocks.org][luarocks]
|
||||
(or other luarocks server), compiles C files (modules) to shared libraries
|
||||
and installs (copies) shared libraries and Lua files to the directory
|
||||
where luarocks is installed. Installed rocks can be loaded from Lua with
|
||||
function `require`.
|
||||
|
||||
Example:
|
||||
```
|
||||
$ luarocks install luasocket
|
||||
$ lua -e 'http = require "socket.http"; print(http.request("http://mxe.cc"))'
|
||||
<!DOCTYPE html>
|
||||
....
|
||||
```
|
||||
|
||||
LuaRocks can used with `make`, `cmake`, custom or builtin
|
||||
[back-ends][backends].
|
||||
|
||||
LuaRocks in MXE
|
||||
---------------
|
||||
|
||||
LuaRocks and some popular rocks were ported to MXE as a plugin.
|
||||
LuaRocks can now be used in the same way as CMake or Make.
|
||||
|
||||
Package `lua` installs native executable usr/bin/lua and
|
||||
cross-compiled lua executable usr/<target>/bin/lua.exe. Native
|
||||
executable is needed since LuaRocks is written in Lua. Cross-compiled
|
||||
one is needed to run Lua scripts loading cross-compiled lua modules.
|
||||
|
||||
Package `luarocks` was added. Luarocks was patched to support new
|
||||
platform `mxe`, inherited from platform `unix`. It uses mix of system
|
||||
tools (e.g., `openssl`, `ln`, `mkdir`), MXE build chain
|
||||
(`i686-w64-mingw32.shared-gcc`, `i686-w64-mingw32.shared-cmake`) and some
|
||||
Windows variables (e.g., "dll" extension for shared libraries). The
|
||||
package is shared-only because Lua loads modules in runtime. It
|
||||
creates prefixed luarocks tool in `usr/bin`. It also creates prefixed
|
||||
wine+lua wrapper aware of locations of dll and lua files installed.
|
||||
This script can be used to test modules in Linux as if running them in
|
||||
Windows.
|
||||
|
||||
There was a difficult choice if `mxe` platform of luarocks is inherited
|
||||
from `windows` or `unix` platform. I tried both and it is less patching
|
||||
for `unix`. For `windows` even build tools differ, while for `unix` a
|
||||
typical rock builds without patching or with minor patching
|
||||
(as other MXE packages).
|
||||
|
||||
LuaRocks can be used to install rocks. With ideal rock it works as follows:
|
||||
|
||||
```
|
||||
$ i686-w64-mingw32.shared-luarocks install <rock>
|
||||
```
|
||||
|
||||
This command downloads rockspeck, downloads sources, verifies checksum
|
||||
(useless thing, because checksum is compared to the value from rockspec
|
||||
file, which itself is neither verified nor signed), builds and installs.
|
||||
|
||||
LuaRocks is not used to download source tarballs (as said
|
||||
above, it doesn't verify checksums properly) using MXE's downloading
|
||||
and verifying facilities instead. Luarocks is used as builder,
|
||||
installer and Lua library (it installs Lua files to
|
||||
`usr/i686-w64-mingw32.shared/share/lua/5.3/luarocks/`).
|
||||
|
||||
Build all rocks:
|
||||
```
|
||||
$ make all-luarocks MXE_PLUGIN_DIRS=plugins/luarocks MXE_TARGETS='i686-w64-mingw32.shared x86_64-w64-mingw32.shared'
|
||||
```
|
||||
|
||||
Run tests (requires wine):
|
||||
```
|
||||
$ ./usr/bin/i686-w64-mingw32.shared-lua plugins/luarocks/test.lua
|
||||
```
|
||||
|
||||
See also:
|
||||
|
||||
* [LuaRocks site][luarocks]
|
||||
* [LuaRocks wiki][wiki]
|
||||
* [the thread in MXE mailing list about LuaRocks in MXE][thread]
|
||||
|
||||
[lua]:https://lua.org/
|
||||
[luarocks]:https://luarocks.org/
|
||||
[backends]:https://github.com/keplerproject/luarocks/wiki/Rockspec-format#Build_backends
|
||||
[wiki]:https://github.com/keplerproject/luarocks/wiki/
|
||||
[thread]:https://lists.nongnu.org/archive/html/mingw-cross-env-list/2015-10/msg00008.html
|
@ -0,0 +1,32 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
From 1d8e959ee39e7a46e150e722af12252448c7ac22 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 11 Oct 2015 01:56:36 +0100
|
||||
Subject: [PATCH] link with kernel32 on MXE
|
||||
|
||||
---
|
||||
rockspecs/lua-llthreads2-scm-0.rockspec | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/rockspecs/lua-llthreads2-scm-0.rockspec b/rockspecs/lua-llthreads2-scm-0.rockspec
|
||||
index 8f907b8..26d5b80 100644
|
||||
--- a/rockspecs/lua-llthreads2-scm-0.rockspec
|
||||
+++ b/rockspecs/lua-llthreads2-scm-0.rockspec
|
||||
@@ -27,6 +27,13 @@ build = {
|
||||
}
|
||||
}
|
||||
},
|
||||
+ mxe = {
|
||||
+ modules = {
|
||||
+ llthreads2 = {
|
||||
+ libraries = {"kernel32"},
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
windows = {
|
||||
modules = {
|
||||
llthreads2 = {
|
||||
--
|
||||
2.1.4
|
||||
|
@ -0,0 +1,23 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := llthreads2
|
||||
$(PKG)_WEBSITE := https://github.com/moteus/lua-llthreads2
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 0.1.3
|
||||
$(PKG)_CHECKSUM := 8c6fc7966cdcc15ae2f89f66ae72f6727a985e7d254f139ecf75a50956a3e8e4
|
||||
$(PKG)_SUBDIR := lua-$(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz
|
||||
$(PKG)_URL := https://github.com/moteus/lua-llthreads2/archive/v$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_DEPS := gcc luarocks
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, moteus/lua-llthreads2, v)
|
||||
endef
|
||||
|
||||
# shared-only because luarocks is shared-only
|
||||
|
||||
define $(PKG)_BUILD_SHARED
|
||||
cd '$(1)' && '$(TARGET)-luarocks' make \
|
||||
rockspecs/lua-llthreads2-scm-0.rockspec
|
||||
endef
|
@ -0,0 +1,54 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
From f271a094f8add34df3f31ac6fb12c9fe683f763a Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sat, 10 Oct 2015 16:40:35 +0100
|
||||
Subject: [PATCH] add rockspec
|
||||
|
||||
Source:https://luarocks.org/modules/gvvaughan/lpeg/1.0.0-1
|
||||
---
|
||||
lpeg-1.0.0-1.rockspec | 32 ++++++++++++++++++++++++++++++++
|
||||
1 file changed, 32 insertions(+)
|
||||
create mode 100644 lpeg-1.0.0-1.rockspec
|
||||
|
||||
diff --git a/lpeg-1.0.0-1.rockspec b/lpeg-1.0.0-1.rockspec
|
||||
new file mode 100644
|
||||
index 0000000..b4fdd27
|
||||
--- /dev/null
|
||||
+++ b/lpeg-1.0.0-1.rockspec
|
||||
@@ -0,0 +1,32 @@
|
||||
+package = "LPeg"
|
||||
+version = "1.0.0-1"
|
||||
+source = {
|
||||
+ url = "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.0.tar.gz",
|
||||
+ md5 = "0aec64ccd13996202ad0c099e2877ece",
|
||||
+}
|
||||
+description = {
|
||||
+ summary = "Parsing Expression Grammars For Lua",
|
||||
+ detailed = [[
|
||||
+ LPeg is a new pattern-matching library for Lua, based on Parsing
|
||||
+ Expression Grammars (PEGs). The nice thing about PEGs is that it
|
||||
+ has a formal basis (instead of being an ad-hoc set of features),
|
||||
+ allows an efficient and simple implementation, and does most things
|
||||
+ we expect from a pattern-matching library (and more, as we can
|
||||
+ define entire grammars).
|
||||
+ ]],
|
||||
+ homepage = "http://www.inf.puc-rio.br/~roberto/lpeg.html",
|
||||
+ maintainer = "Gary V. Vaughan <gary@vaughan.pe>",
|
||||
+ license = "MIT/X11"
|
||||
+}
|
||||
+dependencies = {
|
||||
+ "lua >= 5.1"
|
||||
+}
|
||||
+build = {
|
||||
+ type = "builtin",
|
||||
+ modules = {
|
||||
+ lpeg = {
|
||||
+ "lpcap.c", "lpcode.c", "lpprint.c", "lptree.c", "lpvm.c"
|
||||
+ },
|
||||
+ re = "re.lua"
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.1.4
|
||||
|
@ -0,0 +1,24 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := lpeg
|
||||
$(PKG)_WEBSITE := http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.0.1
|
||||
$(PKG)_CHECKSUM := 62d9f7a9ea3c1f215c77e0cadd8534c6ad9af0fb711c3f89188a8891c72f026b
|
||||
$(PKG)_SUBDIR := lpeg-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz
|
||||
$(PKG)_URL := http://www.inf.puc-rio.br/~roberto/$(PKG)/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS := gcc luarocks
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'http://www.inf.puc-rio.br/~roberto/lpeg/' | \
|
||||
$(SED) -n 's,.*lpeg-\([0-9][^>]*\)\.tar.*,\1,p' | \
|
||||
$(SORT) -h | tail -1
|
||||
endef
|
||||
|
||||
# shared-only because luarocks is shared-only
|
||||
|
||||
define $(PKG)_BUILD_SHARED
|
||||
cd '$(1)' && '$(TARGET)-luarocks' make
|
||||
endef
|
@ -0,0 +1,81 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
From dbedfa6c3b350b6cb2c13d17790a17129ce28721 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 11 Oct 2015 22:47:50 +0200
|
||||
Subject: [PATCH 1/2] use Unix file functions on MinGW
|
||||
|
||||
---
|
||||
src/rapidjson.cpp | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/rapidjson.cpp b/src/rapidjson.cpp
|
||||
index 3b5b129..955009f 100644
|
||||
--- a/src/rapidjson.cpp
|
||||
+++ b/src/rapidjson.cpp
|
||||
@@ -54,7 +54,7 @@ static void setfuncs(lua_State* L, const luaL_Reg *funcs)
|
||||
FILE* openForRead(const char* filename)
|
||||
{
|
||||
FILE* fp = NULL;
|
||||
-#if WIN32
|
||||
+#if WIN32 && !defined(__MINGW32__)
|
||||
fopen_s(&fp, filename, "rb");
|
||||
#else
|
||||
fp = fopen(filename, "r");
|
||||
@@ -66,7 +66,7 @@ FILE* openForRead(const char* filename)
|
||||
FILE* openForWrite(const char* filename)
|
||||
{
|
||||
FILE* fp = NULL;
|
||||
-#if WIN32
|
||||
+#if WIN32 && !defined(__MINGW32__)
|
||||
fopen_s(&fp, filename, "wb");
|
||||
#else
|
||||
fp = fopen(filename, "w");
|
||||
--
|
||||
1.7.10.4
|
||||
|
||||
|
||||
From ad7426ad156f90dcf2b051fe125900caf5b8b2da Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sun, 11 Oct 2015 22:48:26 +0200
|
||||
Subject: [PATCH 2/2] link with Lua libraries on MinGW and MXE
|
||||
|
||||
---
|
||||
rapidjson-0.2.2-1.rockspec | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/rapidjson-0.2.2-1.rockspec b/rapidjson-0.2.2-1.rockspec
|
||||
index 9efe7e1..6ad9188 100644
|
||||
--- a/rapidjson-0.2.2-1.rockspec
|
||||
+++ b/rapidjson-0.2.2-1.rockspec
|
||||
@@ -27,6 +27,13 @@ dependencies = {
|
||||
"lua >= 5.1"
|
||||
}
|
||||
|
||||
+-- windows DLL needs link with importlib.
|
||||
+local link = {
|
||||
+ variables = {
|
||||
+ LUA_LIBRARIES = "$(LUA_LIBDIR)/$(LUALIB)",
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
-- cmake -Bbuild -H. -DBUILD_SHARED_LIBS=ON
|
||||
-- cmake --build build --target install --config Release
|
||||
build = {
|
||||
@@ -39,10 +46,8 @@ build = {
|
||||
},
|
||||
-- Override default build options
|
||||
platforms = {
|
||||
- windows = {
|
||||
- variables = {
|
||||
- LUA_LIBRARIES = "$(LUA_LIBDIR)/$(LUALIB)", -- windows DLL needs link with importlib.
|
||||
- }
|
||||
- }
|
||||
+ windows = link,
|
||||
+ mingw = link,
|
||||
+ mxe = link,
|
||||
}
|
||||
}
|
||||
--
|
||||
1.7.10.4
|
||||
|
@ -0,0 +1,22 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := lua-rapidjson
|
||||
$(PKG)_WEBSITE := https://github.com/xpol/lua-rapidjson
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 0.2.2-1
|
||||
$(PKG)_CHECKSUM := 10783d8633df3f50b1ad33c7de89d2a94a7d9cf45e2ce5217d0d2d5e77396fd2
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz
|
||||
$(PKG)_URL := https://github.com/xpol/lua-rapidjson/archive/v$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_DEPS := gcc luarocks
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, xpol/lua-rapidjson, v)
|
||||
endef
|
||||
|
||||
# shared-only because luarocks is shared-only
|
||||
|
||||
define $(PKG)_BUILD_SHARED
|
||||
cd '$(1)' && '$(TARGET)-luarocks' make
|
||||
endef
|
@ -0,0 +1,6 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
# enable native build for luarocks
|
||||
# leave build rule in src/lua.mk for other uses (i.e. build-pkg)
|
||||
|
||||
lua_TARGETS := $(BUILD) $(MXE_TARGETS)
|
@ -0,0 +1,35 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sat, 10 Oct 2015 17:45:24 +0100
|
||||
Subject: [PATCH] platform MXE
|
||||
|
||||
|
||||
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/luarocks/build/builtin.lua
|
||||
+++ b/src/luarocks/build/builtin.lua
|
||||
@@ -165,7 +165,7 @@ function builtin.run(rockspec)
|
||||
add_flags(extras, "-Wl,-rpath,%s:", libdirs)
|
||||
end
|
||||
add_flags(extras, "-l%s", libraries)
|
||||
- if cfg.is_platform("cygwin") then
|
||||
+ if cfg.is_platform("cygwin") or cfg.is_platform("mxe") then
|
||||
add_flags(extras, "-l%s", {"lua"})
|
||||
end
|
||||
return execute(variables.LD.." "..variables.LIBFLAG, "-o", library, "-L"..variables.LUA_LIBDIR, unpack(extras))
|
||||
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua
|
||||
index 1111111..2222222 100644
|
||||
--- a/src/luarocks/cfg.lua
|
||||
+++ b/src/luarocks/cfg.lua
|
||||
@@ -137,6 +140,7 @@ local platform_order = {
|
||||
linux = 7,
|
||||
macosx = 8,
|
||||
cygwin = 9,
|
||||
+ mxe = 13,
|
||||
-- Windows
|
||||
win32 = 10,
|
||||
mingw32 = 11,
|
@ -0,0 +1,120 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := luarocks
|
||||
$(PKG)_WEBSITE := https://luarocks.org/
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 2.3.0
|
||||
$(PKG)_CHECKSUM := 68e38feeb66052e29ad1935a71b875194ed8b9c67c2223af5f4d4e3e2464ed97
|
||||
$(PKG)_SUBDIR := luarocks-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz
|
||||
$(PKG)_URL := https://keplerproject.github.io/luarocks/releases/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS := gcc lua
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://keplerproject.github.io/luarocks/releases/' | \
|
||||
$(SED) -n 's,.*luarocks-\([0-9][^>]*\)\.tar.*,\1,p' | \
|
||||
$(SORT) -h | tail -1
|
||||
endef
|
||||
|
||||
# shared-only because Lua loads modules in runtime
|
||||
|
||||
define $(PKG)_BUILD_SHARED
|
||||
# Remove LuaRocks config because we change it after installation
|
||||
rm -f '$(PREFIX)/$(TARGET)/etc/luarocks/config-$(lua_SHORTVER).lua'
|
||||
|
||||
cd '$(1)' && ./configure \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--rocks-tree='$(PREFIX)/$(TARGET)' \
|
||||
--lua-version='$(lua_SHORTVER)' \
|
||||
--with-lua='$(PREFIX)/$(TARGET)' \
|
||||
--with-lua-bin='$(PREFIX)/$(BUILD)/bin' \
|
||||
--with-downloader='wget' \
|
||||
--with-md5-checker='openssl'
|
||||
$(MAKE) -C '$(1)' build \
|
||||
LUAROCKS_UNAME_S="MXE" \
|
||||
LUAROCKS_UNAME_M="$(TARGET)"
|
||||
$(MAKE) -C '$(1)' install
|
||||
|
||||
# Generate LuaRocks config.
|
||||
( \
|
||||
echo '-- WARNING! This file is autogenerated by luarocks.mk.'; \
|
||||
echo '-- It will be overwritten by `make luarocks`'; \
|
||||
cat '$(PREFIX)/$(TARGET)/etc/luarocks/config-$(lua_SHORTVER).lua'; \
|
||||
echo 'lib_extension = "dll"'; \
|
||||
echo 'external_lib_extension = "dll"'; \
|
||||
echo 'obj_extension = "obj"'; \
|
||||
echo 'external_deps_dirs = { "$(PREFIX)" }'; \
|
||||
echo 'arch = "mxe-$(TARGET)"'; \
|
||||
echo 'platforms = {'; \
|
||||
echo ' unix = true,'; \
|
||||
echo ' mxe = true,'; \
|
||||
echo '}'; \
|
||||
echo 'cmake_generator = "Unix Makefiles"'; \
|
||||
echo 'variables = {'; \
|
||||
echo ' LUA_BINDIR = "$(PREFIX)/bin",'; \
|
||||
echo ' MAKE = "$(MAKE)",'; \
|
||||
echo ' CMAKE = "$(PREFIX)/bin/$(TARGET)-cmake",'; \
|
||||
echo ' CC = "$(PREFIX)/bin/$(TARGET)-gcc",'; \
|
||||
echo ' CXX = "$(PREFIX)/bin/$(TARGET)-g++",'; \
|
||||
echo ' LD = "$(PREFIX)/bin/$(TARGET)-gcc",'; \
|
||||
echo ' CFLAGS = "-O2",'; \
|
||||
echo ' LIBFLAG = "-shared",'; \
|
||||
echo ' LUALIB = "liblua.dll.a",'; \
|
||||
echo '}'; \
|
||||
echo 'export_path = "SET PATH=%s"'; \
|
||||
echo 'export_path_separator = ";"'; \
|
||||
echo 'export_lua_path = "SET LUA_PATH=%s"'; \
|
||||
echo 'export_lua_cpath = "SET LUA_CPATH=%s"'; \
|
||||
echo 'wrapper_suffix = ".bat"'; \
|
||||
echo 'external_deps_patterns = {'; \
|
||||
echo ' bin = { "?.exe", "?.bat" },'; \
|
||||
echo ' lib = { "?.dll.a", "lib?.dll.a" },'; \
|
||||
echo ' include = { "?.h" }'; \
|
||||
echo '}'; \
|
||||
echo 'runtime_external_deps_patterns = {'; \
|
||||
echo ' bin = { "?.exe", "?.bat" },'; \
|
||||
echo ' lib = { "?.dll" },'; \
|
||||
echo ' include = { "?.h" }'; \
|
||||
echo '}'; \
|
||||
) \
|
||||
> '$(BUILD_DIR)/config.lua'
|
||||
mv '$(BUILD_DIR)/config.lua' \
|
||||
'$(PREFIX)/$(TARGET)/etc/luarocks/config-$(lua_SHORTVER).lua'
|
||||
|
||||
# move installed lua file luarocks to luarocks.lua
|
||||
mv '$(PREFIX)/$(TARGET)/bin/luarocks' '$(PREFIX)/$(TARGET)/bin/luarocks.lua'
|
||||
|
||||
# create bash wrapper adding inter-process mutex
|
||||
# see https://github.com/mxe/mxe/pull/1017#issuecomment-161557440
|
||||
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/luarocks'
|
||||
(echo '#!/usr/bin/env bash'; \
|
||||
echo 'set -ue'; \
|
||||
echo 'echo "== Using MXE wrapper: $(PREFIX)/$(TARGET)/bin/luarocks"'; \
|
||||
echo '# Creating a directory is an atomic operation, that is why'; \
|
||||
echo '# it can be used as a mutex.'; \
|
||||
echo '# See http://wiki.bash-hackers.org/howto/mutex'; \
|
||||
echo 'while ( ! mkdir "$(PREFIX)/$(TARGET)/lib/luarocks/lock.dir" ); do'; \
|
||||
echo ' echo "Waiting for $(PREFIX)/$(TARGET)/lib/luarocks/lock.dir to lock"'; \
|
||||
echo ' sleep 5'; \
|
||||
echo 'done'; \
|
||||
echo 'result=0'; \
|
||||
echo '"$(PREFIX)/$(TARGET)/bin/luarocks.lua" "$$@" || result=$$?'; \
|
||||
echo 'rmdir "$(PREFIX)/$(TARGET)/lib/luarocks/lock.dir"'; \
|
||||
echo 'exit $$result'; \
|
||||
) \
|
||||
> '$(PREFIX)/$(TARGET)/bin/luarocks'
|
||||
chmod 0755 '$(PREFIX)/$(TARGET)/bin/luarocks'
|
||||
# remove lock dir if it exists after previous failed installation
|
||||
-rmdir "$(PREFIX)/$(TARGET)/lib/luarocks/lock.dir"
|
||||
|
||||
# symlink
|
||||
ln -sf '$(PREFIX)/$(TARGET)/bin/luarocks' '$(PREFIX)/bin/$(TARGET)-luarocks'
|
||||
|
||||
# create wine wrapper for testing
|
||||
echo 'LUA_PATH="$(PREFIX)/$(TARGET)/share/lua/$(lua_SHORTVER)/?.lua;$(PREFIX)/$(TARGET)/share/lua/$(lua_SHORTVER)/?/init.lua;$$LUA_PATH"' > '$(PREFIX)/bin/$(TARGET)-lua'
|
||||
echo 'LUA_CPATH="$(PREFIX)/$(TARGET)/lib/lua/$(lua_SHORTVER)/?.dll;;$$LUA_CPATH"' >> '$(PREFIX)/bin/$(TARGET)-lua'
|
||||
echo 'export LUA_PATH LUA_CPATH' >> '$(PREFIX)/bin/$(TARGET)-lua'
|
||||
echo 'exec wine $(PREFIX)/$(TARGET)/bin/lua.exe "$$@"' >> '$(PREFIX)/bin/$(TARGET)-lua'
|
||||
chmod +x '$(PREFIX)/bin/$(TARGET)-lua'
|
||||
endef
|
@ -0,0 +1,64 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
From 11c943734757cf703daa6768b3919b7a580fe8b0 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sat, 10 Oct 2015 22:00:31 +0100
|
||||
Subject: [PATCH 1/2] build on MXE
|
||||
|
||||
---
|
||||
luasocket-scm-0.rockspec | 14 ++++++++++++--
|
||||
src/usocket_dummy.lua | 1 +
|
||||
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||
create mode 100644 src/usocket_dummy.lua
|
||||
|
||||
diff --git a/luasocket-scm-0.rockspec b/luasocket-scm-0.rockspec
|
||||
index f86567b..9b4da80 100644
|
||||
--- a/luasocket-scm-0.rockspec
|
||||
+++ b/luasocket-scm-0.rockspec
|
||||
@@ -46,7 +46,14 @@ local function make_plat(plat)
|
||||
"WINVER=0x0501",
|
||||
"LUASOCKET_API=__declspec(dllexport)",
|
||||
"MIME_API=__declspec(dllexport)"
|
||||
- }
|
||||
+ },
|
||||
+ mxe = {
|
||||
+ "LUASOCKET_DEBUG",
|
||||
+ "LUASOCKET_INET_PTON",
|
||||
+ "WINVER=0x0501",
|
||||
+ "LUASOCKET_API=__declspec(dllexport)",
|
||||
+ "MIME_API=__declspec(dllexport)"
|
||||
+ },
|
||||
}
|
||||
local modules = {
|
||||
["socket.core"] = {
|
||||
@@ -85,9 +92,11 @@ local function make_plat(plat)
|
||||
incdir = "/src"
|
||||
}
|
||||
end
|
||||
- if plat == "win32" or plat == "mingw32" then
|
||||
+ if plat == "win32" or plat == "mingw32" or plat == "mxe" then
|
||||
modules["socket.core"].sources[#modules["socket.core"].sources+1] = "src/wsocket.c"
|
||||
modules["socket.core"].libraries = { "ws2_32" }
|
||||
+ modules["socket.unix"] = "src/usocket_dummy.lua"
|
||||
+ modules["socket.serial"] = "src/usocket_dummy.lua"
|
||||
end
|
||||
return { modules = modules }
|
||||
end
|
||||
@@ -95,6 +104,7 @@ end
|
||||
build = {
|
||||
type = "builtin",
|
||||
platforms = {
|
||||
+ mxe = make_plat("mxe"),
|
||||
unix = make_plat("unix"),
|
||||
macosx = make_plat("macosx"),
|
||||
win32 = make_plat("win32"),
|
||||
diff --git a/src/usocket_dummy.lua b/src/usocket_dummy.lua
|
||||
new file mode 100644
|
||||
index 0000000..3cce676
|
||||
--- /dev/null
|
||||
+++ b/src/usocket_dummy.lua
|
||||
@@ -0,0 +1 @@
|
||||
+return error("This file was created to suppress build of usocket.c for MXE")
|
||||
--
|
||||
2.1.4
|
||||
|
@ -0,0 +1,55 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
From 25007fd7fed18926728b9a1249f827a27e1d03f1 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Sat, 10 Oct 2015 23:14:31 +0100
|
||||
Subject: [PATCH 2/2] luaL_checkint -> luaL_checkinteger
|
||||
|
||||
---
|
||||
gem/gem.c | 2 +-
|
||||
src/luasocket.c | 2 +-
|
||||
src/mime.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/gem/gem.c b/gem/gem.c
|
||||
index 976f74d..40f33b0 100644
|
||||
--- a/gem/gem.c
|
||||
+++ b/gem/gem.c
|
||||
@@ -24,7 +24,7 @@ static int pushchar(int c, int last, const char *marker,
|
||||
}
|
||||
|
||||
static int eol(lua_State *L) {
|
||||
- int context = luaL_checkint(L, 1);
|
||||
+ int context = luaL_checkinteger(L, 1);
|
||||
size_t isize = 0;
|
||||
const char *input = luaL_optlstring(L, 2, NULL, &isize);
|
||||
const char *last = input + isize;
|
||||
diff --git a/src/luasocket.c b/src/luasocket.c
|
||||
index e6ee747..1bdfb13 100644
|
||||
--- a/src/luasocket.c
|
||||
+++ b/src/luasocket.c
|
||||
@@ -64,7 +64,7 @@ static luaL_Reg func[] = {
|
||||
* Skip a few arguments
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int global_skip(lua_State *L) {
|
||||
- int amount = luaL_checkint(L, 1);
|
||||
+ int amount = luaL_checkinteger(L, 1);
|
||||
int ret = lua_gettop(L) - amount - 1;
|
||||
return ret >= 0 ? ret : 0;
|
||||
}
|
||||
diff --git a/src/mime.c b/src/mime.c
|
||||
index dd37dcf..bd9a2a9 100644
|
||||
--- a/src/mime.c
|
||||
+++ b/src/mime.c
|
||||
@@ -661,7 +661,7 @@ static int eolprocess(int c, int last, const char *marker,
|
||||
\*-------------------------------------------------------------------------*/
|
||||
static int mime_global_eol(lua_State *L)
|
||||
{
|
||||
- int ctx = luaL_checkint(L, 1);
|
||||
+ int ctx = luaL_checkinteger(L, 1);
|
||||
size_t isize = 0;
|
||||
const char *input = luaL_optlstring(L, 2, NULL, &isize);
|
||||
const char *last = input + isize;
|
||||
--
|
||||
2.1.4
|
||||
|
@ -0,0 +1,22 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := luasocket
|
||||
$(PKG)_WEBSITE := http://www.impa.br/~diego/software/luasocket
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 3.0-rc1
|
||||
$(PKG)_CHECKSUM := 8b67d9b5b545e1b694753dab7bd6cdbc24c290f2b21ba1e14c77b32817ea1249
|
||||
$(PKG)_SUBDIR := luasocket-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz
|
||||
$(PKG)_URL := https://github.com/diegonehab/luasocket/archive/v$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_DEPS := gcc luarocks
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, diegonehab/luasocket, v)
|
||||
endef
|
||||
|
||||
# shared-only because luarocks is shared-only
|
||||
|
||||
define $(PKG)_BUILD_SHARED
|
||||
cd '$(1)' && '$(TARGET)-luarocks' make
|
||||
endef
|
@ -0,0 +1,68 @@
|
||||
This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
Contains ad hoc patches for cross building.
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Mon, 25 Apr 2016 02:31:37 +0200
|
||||
Subject: [PATCH] add rockspec from upstream
|
||||
|
||||
|
||||
diff --git a/luv-1.9.0-1.rockspec b/luv-1.9.0-1.rockspec
|
||||
new file mode 100644
|
||||
index 1111111..2222222
|
||||
--- /dev/null
|
||||
+++ b/luv-1.9.0-1.rockspec
|
||||
@@ -0,0 +1,34 @@
|
||||
+package = "luv"
|
||||
+version = "1.9.0-1"
|
||||
+source = {
|
||||
+ url = 'https://github.com/luvit/luv/releases/download/'..version..'/luv-'..version..'.tar.gz'
|
||||
+}
|
||||
+
|
||||
+description = {
|
||||
+ summary = "Bare libuv bindings for lua",
|
||||
+ detailed = [[
|
||||
+libuv bindings for luajit and lua 5.1/5.2/5.3.
|
||||
+
|
||||
+This library makes libuv available to lua scripts. It was made for the luvit
|
||||
+project but should usable from nearly any lua project.
|
||||
+ ]],
|
||||
+ homepage = "https://github.com/luvit/luv",
|
||||
+ license = "Apache 2.0"
|
||||
+}
|
||||
+
|
||||
+dependencies = {
|
||||
+ "lua >= 5.1"
|
||||
+}
|
||||
+
|
||||
+build = {
|
||||
+ type = 'cmake',
|
||||
+ variables = {
|
||||
+ CMAKE_C_FLAGS="$(CFLAGS)",
|
||||
+ CMAKE_MODULE_LINKER_FLAGS="$(LIBFLAG)",
|
||||
+ LUA_LIBDIR="$(LUA_LIBDIR)",
|
||||
+ LUA_INCDIR="$(LUA_INCDIR)",
|
||||
+ LUA="$(LUA)",
|
||||
+ LIBDIR="$(LIBDIR)",
|
||||
+ LUADIR="$(LUADIR)",
|
||||
+ },
|
||||
+}
|
||||
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Boris Nagaev <bnagaev@gmail.com>
|
||||
Date: Mon, 25 Apr 2016 02:25:47 +0200
|
||||
Subject: [PATCH] use external libuv
|
||||
|
||||
|
||||
diff --git a/luv-1.9.0-1.rockspec b/luv-1.9.0-1.rockspec
|
||||
index 1111111..2222222 100644
|
||||
--- a/luv-1.9.0-1.rockspec
|
||||
+++ b/luv-1.9.0-1.rockspec
|
||||
@@ -30,5 +30,6 @@ build = {
|
||||
LUA="$(LUA)",
|
||||
LIBDIR="$(LIBDIR)",
|
||||
LUADIR="$(LUADIR)",
|
||||
+ WITH_SHARED_LIBUV="ON",
|
||||
},
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := luv
|
||||
$(PKG)_WEBSITE := https://github.com/luvit/luv
|
||||
$(PKG)_OWNER := https://github.com/starius
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.9.0-1
|
||||
$(PKG)_CHECKSUM := fab5ba54f141711afc432216d03f3664710798204c78a2a7414479f10b2b2d83
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $($(PKG)_SUBDIR).tar.gz
|
||||
$(PKG)_URL := https://github.com/luvit/luv/releases/download/1.9.0-1/$($(PKG)_FILE)
|
||||
$(PKG)_DEPS := gcc libuv luarocks
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(call MXE_GET_GITHUB_TAGS, luvit/luv)
|
||||
endef
|
||||
|
||||
# shared-only because luarocks is shared-only
|
||||
|
||||
define $(PKG)_BUILD_SHARED
|
||||
cd '$(1)' && '$(TARGET)-luarocks' make
|
||||
endef
|
@ -0,0 +1,16 @@
|
||||
local lpeg = require 'lpeg'
|
||||
assert(((lpeg.R('AZ'))^1):match("TEXT") == 5)
|
||||
|
||||
local http = require "socket.http"
|
||||
assert(http.request("http://mxe.cc"):match('MXE'))
|
||||
|
||||
local ll = require 'llthreads2'
|
||||
local thread = ll.new("return 123")
|
||||
thread:start()
|
||||
local ok, result = thread:join()
|
||||
assert(ok)
|
||||
assert(result == 123)
|
||||
|
||||
local rapidjson = require 'rapidjson'
|
||||
assert(rapidjson.encode(123) == '123')
|
||||
assert(rapidjson.decode('["xyz"]')[1] == "xyz")
|
@ -1,18 +1,20 @@
|
||||
# This file is part of MXE.
|
||||
# See index.html for further information.
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := automake
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 1.14.1
|
||||
$(PKG)_CHECKSUM := 814c2333f350ce00034a1fe718e0e4239998ceea7b0aff67e9fd273ed6dfc23b
|
||||
$(PKG)_VERSION := 1.15
|
||||
$(PKG)_CHECKSUM := 7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := http://ftp.gnu.org/pub/gnu/automake/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := ftp://ftp.gnu.org/pub/gnu/automake/$($(PKG)_FILE)
|
||||
$(PKG)_URL := https://ftp.gnu.org/gnu/automake/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := https://ftpmirror.gnu.org/automake/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://www.gnu.org/software/automake
|
||||
$(PKG)_OWNER := https://github.com/tonytheodore
|
||||
$(PKG)_TARGETS := $(BUILD)
|
||||
$(PKG)_DEPS := autoconf
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'http://ftp.gnu.org/gnu/automake/?C=M;O=D' | \
|
||||
$(WGET) -q -O- 'https://ftp.gnu.org/gnu/automake/?C=M;O=D' | \
|
||||
$(SED) -n 's,.*<a href="automake-\([0-9][^"]*\)\.tar.*,\1,p' | \
|
||||
$(SORT) -V | \
|
||||
tail -1
|
@ -0,0 +1 @@
|
||||
../patch.mk
|
@ -0,0 +1,15 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := gettext
|
||||
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
|
||||
$(PKG)_DEPS_$(BUILD) := libiconv
|
||||
|
||||
define $(PKG)_BUILD_$(BUILD)
|
||||
mkdir '$(1).build'
|
||||
cd '$(1).build' && '$(1)/configure' \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--disable-shared \
|
||||
--with-included-libxml
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)' man1_MANS=
|
||||
$(MAKE) -C '$(1).build' -j 1 install man1_MANS=
|
||||
endef
|
@ -1,12 +1,15 @@
|
||||
# This file is part of MXE.
|
||||
# See index.html for further information.
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := intltool
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 0.50.2
|
||||
$(PKG)_CHECKSUM := 67f25c5c6fb71d095793a7f895b245e65e829e8bde68c6c8b4c912144ff34406
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://launchpad.net/intltool/trunk/$($(PKG)_VERSION)/+download/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://freedesktop.org/wiki/Software/intltool
|
||||
$(PKG)_OWNER := https://github.com/tonytheodore
|
||||
$(PKG)_TARGETS := $(BUILD)
|
||||
$(PKG)_DEPS :=
|
||||
|
||||
define $(PKG)_UPDATE
|
@ -0,0 +1 @@
|
||||
../autoconf.mk
|
@ -0,0 +1 @@
|
||||
../automake.mk
|
@ -0,0 +1 @@
|
||||
../gettext.mk
|
@ -0,0 +1 @@
|
||||
../libiconv.mk
|
@ -0,0 +1 @@
|
||||
../libtool.mk
|
@ -0,0 +1 @@
|
||||
../m4.mk
|
@ -0,0 +1,14 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := libiconv
|
||||
$(PKG)_TARGETS := $(BUILD) $(MXE_TARGETS)
|
||||
$(PKG)_DEPS_$(BUILD) :=
|
||||
|
||||
define $(PKG)_BUILD_$(BUILD)
|
||||
mkdir '$(1).build'
|
||||
cd '$(1).build' && '$(1)/configure' \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--disable-shared
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)' man1_MANS=
|
||||
$(MAKE) -C '$(1).build' -j 1 install man1_MANS=
|
||||
endef
|
@ -0,0 +1,14 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := libtool
|
||||
$(PKG)_TARGETS := $(BUILD)
|
||||
$(PKG)_DEPS_$(BUILD) := autoconf automake
|
||||
|
||||
define $(PKG)_BUILD_$(BUILD)
|
||||
mkdir '$(1).build'
|
||||
cd '$(1).build' && '$(1)/configure' \
|
||||
--prefix='$(PREFIX)/$(TARGET)' \
|
||||
--disable-shared
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)'
|
||||
$(MAKE) -C '$(1).build' -j 1 install
|
||||
endef
|
@ -0,0 +1,29 @@
|
||||
# This file is part of MXE. See LICENSE.md for licensing information.
|
||||
|
||||
PKG := patch
|
||||
$(PKG)_IGNORE :=
|
||||
$(PKG)_VERSION := 2.7.5
|
||||
$(PKG)_CHECKSUM := 7436f5a19f93c3ca83153ce9c5cbe4847e97c5d956e57a220121e741f6e7968f
|
||||
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
|
||||
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
|
||||
$(PKG)_URL := https://ftp.gnu.org/gnu/$(PKG)/$($(PKG)_FILE)
|
||||
$(PKG)_URL_2 := https://ftpmirror.gnu.org/$(PKG)/$($(PKG)_FILE)
|
||||
$(PKG)_WEBSITE := https://www.gnu.org/software/$(PKG)
|
||||
$(PKG)_OWNER := https://github.com/tonytheodore
|
||||
$(PKG)_TARGETS := $(BUILD)
|
||||
$(PKG)_DEPS :=
|
||||
|
||||
define $(PKG)_UPDATE
|
||||
$(WGET) -q -O- 'https://ftp.gnu.org/gnu/patch/?C=M;O=D' | \
|
||||
$(SED) -n 's,.*<a href="patch-\([0-9][^"]*\)\.tar.*,\1,p' | \
|
||||
$(SORT) -V | \
|
||||
tail -1
|
||||
endef
|
||||
|
||||
define $(PKG)_BUILD_$(BUILD)
|
||||
mkdir '$(1).build'
|
||||
cd '$(1).build' && '$(1)/configure' \
|
||||
--prefix='$(PREFIX)/$(TARGET)'
|
||||
$(MAKE) -C '$(1).build' -j '$(JOBS)' man1_MANS=
|
||||
$(MAKE) -C '$(1).build' -j 1 install man1_MANS=
|
||||
endef
|
@ -0,0 +1 @@
|
||||
../gettext.mk
|
@ -0,0 +1 @@
|
||||
../libiconv.mk
|
@ -0,0 +1 @@
|
||||
../autoconf.mk
|
@ -0,0 +1 @@
|
||||
../automake.mk
|
@ -0,0 +1 @@
|
||||
../gettext.mk
|
@ -0,0 +1 @@
|
||||
../libiconv.mk
|