mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-02-05 17:44:32 +01:00
OK to build ttyd on MSYS2 (#30)
This commit is contained in:
10
README.md
10
README.md
@@ -37,6 +37,13 @@ make && make install
|
||||
|
||||
> **NOTE:** You may need to compile libwebsockets from source for ubuntu versions old than 16.04, since they have outdated `libwebsockets-dev` package ([Issue #6][9]).
|
||||
|
||||
## Install on Windows
|
||||
|
||||
ttyd can be built with [MSYS2][10] on windows, [follow the instructions here](msys2).
|
||||
|
||||
> **NOTE:** Native windows console programs may not work correctly due to [pty incompatibility issues][11].
|
||||
As a workaround, you can use [winpty][12] as a wrapper to invoke the windows program, eg: `ttyd winpty cmd`.
|
||||
|
||||
## Install on OpenWrt/LEDE
|
||||
|
||||
```bash
|
||||
@@ -147,3 +154,6 @@ Docker containers are jailed environments which are more secure, this is useful
|
||||
[7]: http://brew.sh
|
||||
[8]: https://chromium.googlesource.com/apps/libapps/+/HEAD/hterm
|
||||
[9]: https://github.com/tsl0922/ttyd/issues/6
|
||||
[10]: http://msys2.github.io
|
||||
[11]: https://github.com/mintty/mintty/blob/master/wiki/Tips.md#inputoutput-interaction-with-alien-programs
|
||||
[12]: https://github.com/rprichard/winpty
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
### Build the inlined html
|
||||
# Building the inlined html
|
||||
|
||||
install [Yarn](https://yarnpkg.com), then run the following commands:
|
||||
|
||||
|
||||
7
msys2/README.md
Normal file
7
msys2/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Building ttyd with [MSYS2][1]
|
||||
|
||||
1. Download and install the **latest** version of [MSYS2][1], make sure you've updated the package database.
|
||||
2. Build json-c and libwebsockets: cd to package dir and run `makepkg -s && pacman -U *.pkg.tar.xz`.
|
||||
3. Build ttyd: cd to ttyd dir and run `makepkg --skipchecksums`.
|
||||
|
||||
[1]: http://msys2.github.io
|
||||
27
msys2/json-c/PKGBUILD
Normal file
27
msys2/json-c/PKGBUILD
Normal file
@@ -0,0 +1,27 @@
|
||||
# Maintainer: Shuanglei Tao <tsl0922@gmail.com>
|
||||
|
||||
pkgname=json-c
|
||||
pkgver=0.12.1
|
||||
pkgrel=1
|
||||
pkgdesc="A JSON implementation in C"
|
||||
arch=('any')
|
||||
url="https://github.com/json-c/json-c"
|
||||
license=('MIT')
|
||||
makedepends=('gcc' 'make' 'autoconf')
|
||||
source=("https://s3.amazonaws.com/json-c_releases/releases/${pkgname}-${pkgver}.tar.gz")
|
||||
sha256sums=('2a136451a7932d80b7d197b10441e26e39428d67b1443ec43bbba824705e1123')
|
||||
|
||||
build() {
|
||||
cd ${srcdir}/${pkgname}-${pkgver}
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--enable-shared \
|
||||
--enable-static
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
options=('staticlibs')
|
||||
cd ${srcdir}/${pkgname}-${pkgver}
|
||||
make DESTDIR="$pkgdir" install
|
||||
}
|
||||
37
msys2/libwebsockets/PKGBUILD
Normal file
37
msys2/libwebsockets/PKGBUILD
Normal file
@@ -0,0 +1,37 @@
|
||||
# Maintainer: Shuanglei Tao <tsl0922@gmail.com>
|
||||
|
||||
pkgname="libwebsockets"
|
||||
pkgver=2.1.0
|
||||
pkgrel=1
|
||||
pkgdesc="A lightweight pure C library for websockets (msys)"
|
||||
arch=('any')
|
||||
url="http://libwebsockets.org"
|
||||
license=('LGPL 2.1')
|
||||
makedepends=('gcc' 'cmake' 'zlib-devel' 'openssl-devel')
|
||||
source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/warmcat/${pkgname}/archive/v${pkgver}.tar.gz")
|
||||
sha256sums=('bcc96aaa609daae4d3f7ab1ee480126709ef4f6a8bf9c85de40aae48e38cce66')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
}
|
||||
|
||||
build() {
|
||||
mkdir -p "${srcdir}/build-${CARCH}"
|
||||
cd "${srcdir}/build-${CARCH}"
|
||||
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DLWS_USE_BUNDLED_ZLIB=OFF \
|
||||
-DLWS_WITHOUT_TESTAPPS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
../${pkgname}-${pkgver}
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
depends=('zlib-devel' 'openssl-devel')
|
||||
options=('staticlibs')
|
||||
cd "${srcdir}/build-${CARCH}"
|
||||
make DESTDIR=${pkgdir} install
|
||||
}
|
||||
34
msys2/ttyd/PKGBUILD
Normal file
34
msys2/ttyd/PKGBUILD
Normal file
@@ -0,0 +1,34 @@
|
||||
# Maintainer: Shuanglei Tao <tsl0922@gmail.com>
|
||||
|
||||
pkgname="ttyd"
|
||||
pkgver=master
|
||||
pkgrel=1
|
||||
pkgdesc="A command-line tool for sharing terminal over the web"
|
||||
arch=('any')
|
||||
url="https://github.com/tsl0922/ttyd"
|
||||
license=('MIT')
|
||||
makedepends=('gcc' 'cmake' 'json-c' 'libwebsockets')
|
||||
source=(${pkgname}-${pkgver}.tar.gz::"https://github.com/tsl0922/${pkgname}/archive/${pkgver}.tar.gz")
|
||||
sha256sums=('6f4f5e30d92ea1694ce528bdebb892a92aac5dda1ce13ea3b1ce7b865b971f85')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
}
|
||||
|
||||
build() {
|
||||
mkdir -p "${srcdir}/build-${CARCH}"
|
||||
cd "${srcdir}/build-${CARCH}"
|
||||
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
../${pkgname}-${pkgver}
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
options=('staticlibs' 'strip')
|
||||
cd "${srcdir}/build-${CARCH}"
|
||||
make DESTDIR=${pkgdir} install
|
||||
}
|
||||
Reference in New Issue
Block a user