Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add go-ipfs 0.8.0 #14225

Merged
merged 16 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions recipes/go-ipfs/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
copy "%RECIPE_DIR%\build_win.sh" .
if %errorlevel% neq 0 exit /b %errorlevel%

set PREFIX=%PREFIX:\=/%
set SRC_DIR=%SRC_DIR:\=/%
set MSYSTEM=MINGW%ARCH%
set MSYS2_PATH_TYPE=inherit
set CHERE_INVOKING=1


bash -lc "./build_win.sh"
if %errorlevel% neq 0 exit /b %errorlevel%

exit /b 0
16 changes: 16 additions & 0 deletions recipes/go-ipfs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -eux

export GOPATH="$( pwd )"
export CGO_ENABLED=1
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CPPFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=vendor -modcacherw"
export GOTAGS="openssl"

module='github.com/ipfs/go-ipfs'

make -C "src/${module}" install nofuse

bash $RECIPE_DIR/build_library_licenses.sh
13 changes: 13 additions & 0 deletions recipes/go-ipfs/build_library_licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -eux

export LIBRARY_LICENSES_PATH="$SRC_DIR/library_licenses/"

go-licenses save \
"github.com/ipfs/go-ipfs/cmd/ipfs" \
--save_path "$LIBRARY_LICENSES_PATH" \
2>&1 \
| tee "$SRC_DIR/go-licenses.log" \
|| echo "ignoring errors until go-licenses --ignore is available"

find "$LIBRARY_LICENSES_PATH"
18 changes: 18 additions & 0 deletions recipes/go-ipfs/build_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -eux

export GOPATH="$( pwd )"
export CGO_ENABLED=0
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=vendor -modcacherw"

# omissions from the unix build, needs investigation
# export GOTAGS="openssl"
# export CGO_CFLAGS="${CFLAGS}"
# export CGO_CXXFLAGS="${CPPFLAGS}"
# export CGO_LDFLAGS="${LDFLAGS}"

module='github.com/ipfs/go-ipfs'

make -C "src/${module}" install nofuse

bash $RECIPE_DIR/build_library_licenses.sh
158 changes: 158 additions & 0 deletions recipes/go-ipfs/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{% set name = "go-ipfs" %}
{% set version = "0.8.0" %}
{% set gomodule = "github.com/ipfs/" ~ name %}
{% set rawgit = "https://raw.githubusercontent.com" %}
{% set ext = "extra_licenses/github.com" %}

package:
name: {{ name }}
version: {{ version }}

source:
- folder: src/{{ gomodule }}
url: https://{{ gomodule }}/releases/download/v{{ version }}/{{ name }}-source.tar.gz
sha256: b8adfe124af900cea69869a31528f5468b66e696c7eb9ec161494ff41dfd584c

# TODO: remove licenses as they become discoverable by go-licenses
- fn: {{ version }}-go-base36-LICENSE.md
folder: {{ ext }}/multiformats/go-base36
url: {{ rawgit }}/multiformats/go-base36/master/LICENSE.md
sha256: b5f1f21b1eea5d68df829130c545b431e9c277dd73f68a777e641e44c7fa2f0e

- fn: {{ version }}-bbloom-LICENSE
folder: {{ ext }}/ipfs/bbloom
url: {{ rawgit }}/ipfs/bbloom/master/LICENSE
sha256: 6dd1cec8fe966990fbcdd00ca64e05604c66bd1fa1573d862dceaf18cde869e4

- fn: {{ version }}-go-verifcid-LICENSE-APACHE
folder: {{ ext }}/ipfs/go-verifcid
url: {{ rawgit }}/ipfs/go-verifcid/master/LICENSE-APACHE
sha256: 3bdae09f3c8ebd66a845e7fbb2188b8c32de6a17572f0a8a0cb91428930fc8e1

- fn: {{ version }}-go-verifcid-LICENSE-MIT
folder: {{ ext }}/ipfs/go-verifcid
url: {{ rawgit }}/ipfs/go-verifcid/master/LICENSE-MIT
sha256: 47c42c24d17bb4a451e31781fe0ee986413ca5eec5b0c163100ea96d90647de6

- fn: {{ version }}-cbor-gen-LICENSE
folder: {{ ext }}/whyrusleeping/cbor-gen
url: {{ rawgit }}/whyrusleeping/cbor-gen/master/LICENSE
sha256: d3920bcadcb9dade972fcb90fe7e6612bb94edbf64e7c347c2904d7561c0dba7

- fn: {{ version }}-go-cidutil-LICENSE
folder: {{ ext }}/ipfs/go-cidutil
url: {{ rawgit }}/ipfs/go-cidutil/master/LICENSE
sha256: bfe24471d0666e27fba8a36fff0bfa96fe972408ea2834140ffdcc549789ad55

- fn: {{ version }}-cidenc-LICENSE
folder: {{ ext }}/ipfs/go-cidutil/cidenc
url: {{ rawgit }}/ipfs/go-cidutil/master/LICENSE
sha256: bfe24471d0666e27fba8a36fff0bfa96fe972408ea2834140ffdcc549789ad55

- fn: {{ version }}-go-pinning-service-http-client-LICENSE
folder: {{ ext }}/ipfs/go-pinning-service-http-client
url: {{ rawgit }}/ipfs/go-pinning-service-http-client/master/LICENSE
sha256: bacbdeaa25c05e1d5176afb95473f54b67aff62f987a44eba9383e352b8cc7f9

- fn: {{ version }}-go-pinning-service-http-client-openapi-LICENSE
folder: {{ ext }}/ipfs/go-pinning-service-http-client/openapi
url: {{ rawgit }}/ipfs/go-pinning-service-http-client/master/LICENSE
sha256: bacbdeaa25c05e1d5176afb95473f54b67aff62f987a44eba9383e352b8cc7f9

- fn: {{ version }}-go-libp2p-asn-util-LICENSE
folder: {{ ext }}/libp2p/go-libp2p-asn-util
url: {{ rawgit }}/libp2p/go-libp2p-asn-util/master/LICENSE
sha256: bfe24471d0666e27fba8a36fff0bfa96fe972408ea2834140ffdcc549789ad55

# MIT, upstream PR created https://github.com/ipld/go-car/pull/46
- fn: {{ version }}-go-car-LICENSE
folder: {{ ext }}/ipld/go-car
url: {{ rawgit }}/ipld/go-car/f9b9b98cd03a10c2d400dc39a0735afdfecd2bfb/LICENSE
sha256: eda6efe544c803f0da9859a6272564d338dad7a0ab997e7d5de2159d2ff23841

- fn: {{ version }}-go-car-util-LICENSE
folder: {{ ext }}/ipld/go-car/util
url: {{ rawgit }}/ipld/go-car/f9b9b98cd03a10c2d400dc39a0735afdfecd2bfb/LICENSE
sha256: eda6efe544c803f0da9859a6272564d338dad7a0ab997e7d5de2159d2ff23841

# PR created, https://github.com/libp2p/go-libp2p-noise/pull/91
- fn: {{ version }}-go-libp2p-noise-LICENSE
folder: {{ ext }}/libp2p/go-libp2p-noise
url: {{ rawgit }}/libp2p/go-libp2p-noise/fb344256fe872f9b45e4be74db9546c9885d4e04/LICENSE
sha256: d2bf9322f95cbccfa2aedcdf27bfa0bebd47ed7b03c1dd2a24b25d32608ad7e7

- fn: {{ version }}-go-libp2p-noise-pb-LICENSE
folder: {{ ext }}/libp2p/go-libp2p-noise/pb
url: {{ rawgit }}/libp2p/go-libp2p-noise/fb344256fe872f9b45e4be74db9546c9885d4e04/LICENSE
sha256: d2bf9322f95cbccfa2aedcdf27bfa0bebd47ed7b03c1dd2a24b25d32608ad7e7

# MIT license, not in repo, using licenses from neighbors
- fn: {{ version }}-go-ipld-git-LICENSE
folder: {{ ext }}/ipfs/go-ipld-git
url: {{ rawgit }}/ipfs/go-cidutil/master/LICENSE
sha256: bfe24471d0666e27fba8a36fff0bfa96fe972408ea2834140ffdcc549789ad55

- fn: {{ version }}-base32-LICENSE
folder: {{ ext }}/whyrusleeping/base32
url: {{ rawgit }}/whyrusleeping/cbor-gen/master/LICENSE
sha256: d3920bcadcb9dade972fcb90fe7e6612bb94edbf64e7c347c2904d7561c0dba7


build:
number: 0
skip: true # [osx]

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('go-cgo') }} # [unix]
- {{ compiler('go') }} # [win]
- posix # [win]
- go-licenses
- make # [unix]
host:
- openssl # [unix]

{% set cid = "/ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc" %}
{% set ipfs_args = "-c ./.ipfs-repo --debug" %}

test:
commands:
- ipfs --version
- ipfs --help
- ipfs commands
- ipfs {{ ipfs_args }} init
- ipfs {{ ipfs_args }} ls {{ cid }}
- ipfs {{ ipfs_args }} refs {{ cid }}
- ipfs {{ ipfs_args }} cat {{ cid }}/readme
- ipfs {{ ipfs_args }} get {{ cid }}
- echo 'hello world' > hello.txt
- ipfs {{ ipfs_args }} add hello.txt

about:
home: https://ipfs.io
license: Apache-2.0 or MIT
license_file:
# directly provided by upstream
- src/{{ gomodule }}/LICENSE-APACHE
- src/{{ gomodule }}/LICENSE-MIT
# ~10 upstreams fail.
- library_licenses/
- go-licenses.log
# these have since added license files, or have upstream PRs to do so
- extra_licenses/

summary: 'IPFS implementation in Go'

description: |
IPFS is a global, versioned, peer-to-peer filesystem. It combines good ideas
from previous systems such as Git, BitTorrent, Kademlia, SFS, and the Web.
It is like a single BitTorrent swarm, exchanging git objects. IPFS provides
an interface as simple as the HTTP web, but with permanence built-in. You
can also mount the world at /ipfs.
doc_url: https://docs.ipfs.io
dev_url: https://{{ gomodule }}

extra:
recipe-maintainers:
- bollwyvl
15 changes: 15 additions & 0 deletions recipes/go-ipfs/test_ipfs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -eux
export IPFS_PATH=$(pwd)/.ipfs-repo

echo "does it init"
ipfs --debug init
ls -lathr $IPFS_PATH

echo "does it fetch"
ipfs --debug cat /ipfs/QmQPeNsJPyVWPFDVHb77w8G42Fvo15z4bG2X8D2GhfbSXc/readme | tee readme
cat readme | grep Hello

echo "does it add"
ipfs --debug add readme | tee added.txt
cat added.txt | grep QmPZ9gcCEpqKTo6aq61g2nXGUhM4iCL3ewB6LDXZCtioEB