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

[wip] Add go-ipfs 0.7.0 #13904

Closed
wants to merge 12 commits into from
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
11 changes: 11 additions & 0 deletions recipes/go-ipfs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -eux

export GOPATH="$( pwd )"
export CGO_ENABLED=1

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

make -C "src/${module}" \
install \
GOTAGS=openssl
10 changes: 10 additions & 0 deletions recipes/go-ipfs/build_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eux

export GOPATH="$( pwd )"
export CGO_ENABLED=0

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

make -C "src/${module}" \
install
86 changes: 86 additions & 0 deletions recipes/go-ipfs/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{% set version = "0.7.0" %}

package:
name: go-ipfs
version: {{ version }}

source:
url: https://github.com/ipfs/go-ipfs/releases/download/v{{ version }}/go-ipfs-source.tar.gz
sha256: c349802561a61c1efeade4e3e681723b76e9192edacc5a955cf5f68e49e57fba
folder: src/github.com/ipfs/go-ipfs

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:
- src/github.com/ipfs/go-ipfs/LICENSE-APACHE
- src/github.com/ipfs/go-ipfs/LICENSE-MIT
# TODO: on linux, about 10 upstreams fail (many are ipfs/ipld first-party)
# - third-party-licenses.txt
#
# gather_licenses ./third-party-licenses.txt "${module}/cmd/ipfs"
#
# fails with
#
# F0206 15:06:39.374624 156753 main.go:43] one or more libraries have an incompatible/unknown license:
# map["unknown":[
# "github.com/ipfs/go-ipfs/vendor/github.com/ipfs/bbloom"
# "github.com/ipfs/go-ipfs/vendor/github.com/ipfs/go-cidutil"
# "github.com/ipfs/go-ipfs/vendor/github.com/ipfs/go-cidutil/cidenc"
# "github.com/ipfs/go-ipfs/vendor/github.com/ipfs/go-ipld-git"
# "github.com/ipfs/go-ipfs/vendor/github.com/ipfs/go-verifcid"
# "github.com/ipfs/go-ipfs/vendor/github.com/ipld/go-car"
# "github.com/ipfs/go-ipfs/vendor/github.com/ipld/go-car/util"
# "github.com/ipfs/go-ipfs/vendor/github.com/libp2p/go-libp2p-asn-util"
# "github.com/ipfs/go-ipfs/vendor/github.com/libp2p/go-libp2p-noise"
# "github.com/ipfs/go-ipfs/vendor/github.com/libp2p/go-libp2p-noise/pb"
# "github.com/ipfs/go-ipfs/vendor/github.com/multiformats/go-base36"
# "github.com/ipfs/go-ipfs/vendor/github.com/whyrusleeping/base32"
# "github.com/ipfs/go-ipfs/vendor/github.com/whyrusleeping/cbor-gen"
# ]]

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://github.com/ipfs/go-ipfs

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